Hey guys
I currently got this prop hunt server running but when more than 10 players are on each team the spawn system messes up and starts spawning players into each other causing them to die.
Now I figured out that if I give them godmode for lets say 10 seconds they should be fine.. right? :P
Now im a total noob in LUA i've so much figured out that I need:
[QUOTE]for k, v in pairs( player.GetAll() ) do
v:GodEnable()
end
[/QUOTE]
then a sleep for 10 seconds, and then disable godmode.
Thanks,
Vincent
run that - then use the timer.Simple function, make it run once, 10 second delay, in the function do the same code as above, except disabling godmode instead of enabling it.
sec ill just write an example
[editline]10th January 2014[/editline]
[lua]
local _PLAYER = FindMetaTable("Player");
function _PLAYER:Invulnerability( duration )
local timerEntry = self:SteamID() .. "_god_timer";
if ( timer.Exists(timerEntry) ) then
timer.Destroy(timerEntry)
self:GodDisable();
end;
self:GodEnable();
timer.Create( timerEntry, duration, 1, function()
if ( self and self:IsValid() ) then
self:GodDisable();
end;
end);
end;
[/lua]
usage is player:Invulnerability(30), that'd be 30 seconds of god mode then it will disable.
also alternatively you could set people to have no physics collisions for the first like 20 seconds
or add more spawnpoints( best option )
[QUOTE=LauScript;43488333]run that - then use the timer.Simple function, make it run once, 10 second delay, in the function do the same code as above, except disabling godmode instead of enabling it.
sec ill just write an example
[editline]10th January 2014[/editline]
[lua]
local _PLAYER = FindMetaTable("Player");
function _PLAYER:Invulnerability( duration )
local timerEntry = self:SteamID() .. "_god_timer";
if ( timer.Exists(timerEntry) ) then
timer.Destroy(timerEntry)
self:GodDisable();
end;
timer.Create( timerEntry, duration, 1, function()
if ( self and self:IsValid() ) then
self:GodDisbable();
end;
end);
end;
[/lua]
usage is player:Invulnerability(30), that'd be 30 seconds of god mode then it will disable.
also alternatively you could set people to have no physics collisions for the first like 20 seconds
or add more spawnpoints( best option )[/QUOTE]
Alright! Thanks for the help!
i made an error - forgot to give them godmode, lol.
look at it now.
[QUOTE=LauScript;43488548]i made an error - forgot to give them godmode, lol.
look at it now.[/QUOTE]
Haha alright, ill test it once my server is empty :)
Any chance you can guide me how to insert this so it activates at every round?
add me to steam
Sorry, you need to Log In to post a reply to this thread.