Skip to content

Commit

Permalink
Change color to use r g b a keys (#1971)
Browse files Browse the repository at this point in the history
  • Loading branch information
thegrb93 authored Jan 12, 2025
1 parent 6a6efc1 commit 552e0e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/starfall/libs_sh/entities.lua
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ function ents_methods:setColor(clr)
checkpermission(instance, ent, "entities.setRenderProperty")
end

local r,g,b,a = tonumber(clr[1]) or 255, tonumber(clr[2]) or 255, tonumber(clr[3]) or 255, tonumber(clr[4]) or 255
local r,g,b,a = tonumber(clr.r) or 255, tonumber(clr.g) or 255, tonumber(clr.b) or 255, tonumber(clr.a) or 255
local rendermode = (a == 255 and RENDERMODE_NORMAL or RENDERMODE_TRANSALPHA)
Ent_SetColor4Part(ent, r, g, b, a)
Ent_SetRenderMode(ent, rendermode)
Expand Down

0 comments on commit 552e0e3

Please sign in to comment.