StarfallEx
StarfallEx copied to clipboard
add setPlayerColor for cl holos
this method of doing it doesn't work on serverside
Would be nice if the argument was just a normal color object.
Also, how about this
lua/starfall/libs_sh/entities.lua#204
local playerColorWhitelist = {
["prop_ragdoll"] = true,
["starfall_cnextbot"] = true,
["starfall_hologram"] = true,
["gmod_wire_hologram"] = true,
}
--- Sets the sheet color of a player-model
-- Can only be used on ragdolls, holograms and Starfall NextBots
-- @client
-- @param Color clr RGB color to use, alpha not supported
function ents_methods:setPlayerColor(clr)
local ent = getent(self)
if not playerColorWhitelist[ent:GetClass()] then SF.Throw("The entity isn't whitelisted", 2) end
checkpermission(instance, ent, "entities.setRenderProperty")
clr = cunwrap(clr)
local vec = Vector(clr.r / 255, clr.g / 255, clr.b / 255)
ent.GetPlayerColor = function() return vec end
end
Also also, maybe setPlayerModelColor, setPlayerSheetColor instead of setPlayerColor?
Whitelist is good idea. The reason it's a Vector is because that's what the function expects.
When might this get merged? working on code that could really use this
I think player and bot support would be good to be added before it's merged.
I think player and bot support would be good to be added before it's merged.
https://github.com/ZH-Hristov/StarfallEx/pull/1
yeah, that'd be best considering bots are what I intend to use it for