I am trying to make a swep that turns a player invisible with PrimaryAttack,
but althought I havent tested, I am sure using LocalPlayer():SetColor(0,0,0,0) will only turn his playermodel invisible
but the job tags or healthbar that is hovering above his head is still visible after being turned invisible
How can I work around this?
[CODE]function SWEP:PrimaryAttack()
if ( CLIENT ) then return end
LocalPlayer():SetColor(0,0,0,0)
end
[/CODE]
Seeing as you are using DarkRP, you could use the cloak command: [url]https://github.com/FPtje/DarkRP/blob/353dc3286092cdb2efade2cc0f2145db5a6c2e69/gamemode/modules/fadmin/fadmin/playeractions/cloak/sv_init.lua[/url]
That code shouldn't work at all: LocalPlayer is clientside only. But anyway, you should be using SetNoDraw.
[QUOTE=code_gs;52625503]That code shouldn't work at all: LocalPlayer is clientside only. But anyway, you should be using SetNoDraw.[/QUOTE]
havent done lua in a few months, how do I correctly call the swep owner ?
[CODE]function SWEP:PrimaryAttack()
if ( CLIENT ) then return end
if self:GetNoDraw() = false then
drawing = true
else
drawing = false
end
self:SetNoDraw(drawing)
end[/CODE]
its just self.Owner
Okay thanks! Works now, but is there also a way to stop the player from making step sounds?
Sorry, you need to Log In to post a reply to this thread.