• Invisible player
    7 replies, posted
Hello, i was trying to made a invisible player script. So i try this: [code]if SERVER then function FNodraw(ply) ply:SetColor(255,255,255,0) ply:ChatPrint("You are now invisible.") end function FYesdraw(ply) ply:SetColor(255,255,255,255) ply:ChatPrint("You are not anymore invisible.") end concommand.Add( "+invisible", FNodraw) concommand.Add( "-invisible", FYesdraw) end[/code] Everything works good, the concommand, everything. Only has a problem: the player get purple when i exec the command. I do not know how to make the player totally invisible, someone know? If you know, please, help? ( Sorry for my bad english, English is not my first language. )
Entity:SetColor(Color(red, green, blue, alpha = 255)) local col = Entity:GetColor() Entity:SetColor(Color(col.r, col.g, col.b, col.a))
also Entity:SetRenderMode(1) before setting the color.
players already have their rendermode to RENDERMODE_TRANSCOLOR
[QUOTE=G4MB!T;38188302]Entity:SetColor(Color(red, green, blue, alpha = 255)) local col = Entity:GetColor() Entity:SetColor(Color(col.r, col.g, col.b, col.a))[/QUOTE] And how take back to the normal player colour?
store their color first. ie: [lua] Player.__DefaultColor = Player:GetColor(); [/lua] then when you go to change their color just use: [lua] Player:SetColor(Player.__DefaultColor) [/lua]
[QUOTE=G4MB!T;38193540]store their color first. ie: [lua] Player.__DefaultColor = Player:GetColor(); [/lua] then when you go to change their color just use: [lua] Player:SetColor(Player.__DefaultColor) [/lua][/QUOTE] Thank you very much.
:) no problem
Sorry, you need to Log In to post a reply to this thread.