Hi,
I tested this for give Noclip+Cloak when press key v but Cloak don't work
I put my addon file to my server addons/lua/autorun/noclipcloak.lua
[CODE]timer.Create( "NoclipCloak", 0.1, 0, function()
for k,pl in pairs(player.GetAll()) do
local oldstate = pl:GetMoveType()
f oldstate != MOVETYPE_NOCLIP or pl:InVehicle() then
pl:SetColor(Color( 255, 255, 255, 255 ));
pl:SetNoDraw(false)
else
pl:SetColor(Color( 255, 255, 255, 0 ));
pl:SetNoDraw(true)
end
end
end )[/CODE]
thx fot your help
[QUOTE=ST3BL;51066310]Hi,
I tested this for give Noclip+Cloak when press key v but Cloak don't work
I put my addon file to my server addons/lua/autorun/noclipcloak.lua
[CODE]timer.Create( "NoclipCloak", 0.1, 0, function()
for k,pl in pairs(player.GetAll()) do
local oldstate = pl:GetMoveType()
f oldstate != MOVETYPE_NOCLIP or pl:InVehicle() then -- You missed the i in if
pl:SetColor(Color( 255, 255, 255, 255 )); -- Here you don't need to end your lines with semi colons its Lua
pl:SetNoDraw(false)
else
pl:SetColor(Color( 255, 255, 255, 0 ));
pl:SetNoDraw(true)
end
end
end )[/CODE]
thx fot your help[/QUOTE]
It would be easier if you posted the errors next time.
I have no errors, juste no work[QUOTE=techwarfare;51066784]It would be easier if you posted the errors next time.[/QUOTE]
Write a check within the timer to check if the player has spawned and is valid.
you mean this [CODE]for k, ply in pairs(player.GetAll()) do
if IsValid(ply) and ply:Alive() then[/CODE][QUOTE=techwarfare;51066799]Write a check within the timer to check if the player has spawned and is valid.[/QUOTE]
Yeah, now try.
I have this error [CODE]
[ERROR] addons/invisible noclip 087/lua/autorun/noclipcloak.lua:6: '=' expected near 'oldstate'
1. unknown - addons/invisible noclip 087/lua/autorun/noclipcloak.lua:0
[/CODE] [QUOTE=techwarfare;51066858]Yeah, now try.[/QUOTE]
[editline]18th September 2016[/editline]
ok sry work now thx for your help [QUOTE=ST3BL;51066887]I have this error [CODE]
[ERROR] addons/invisible noclip 087/lua/autorun/noclipcloak.lua:6: '=' expected near 'oldstate'
1. unknown - addons/invisible noclip 087/lua/autorun/noclipcloak.lua:0
[/CODE][/QUOTE]
[editline]18th September 2016[/editline]
how to ensure that the weapon is also invisible ?
Sorry, you need to Log In to post a reply to this thread.