I tried to make survivor's and zombie's health and runspeed and walk speed and models different, the only thing that worked were the models...
[lua]
function GM:PlayerSpawn( ply ) //What happens when the player spawns
self.BaseClass:PlayerSpawn( ply )
ply:SetGravity( 1 )
if ply:Team() == 2 then // If he is a survivor
ply:SetMaxHealth( 100, true )
ply:SetWalkSpeed( 275 )
ply:SetRunSpeed( 325 )
ply:SetModel( "models/player/group01/male_01.mdl" ) //Give him a human player model
elseif ply:Team() == 3 then // If he is a zombie
ply:SetMaxHealth( 200, true )
ply:SetWalkSpeed( 280 )
ply:SetRunSpeed( 335 )
ply:SetModel( "models/player/classic.mdl" ) //Give him a zombie player model
end
end
[/lua]
This is pretty basic code, I have no idea how I screwed up on this...
Everything was set to the base gamemode defaults(100 hp, 275 walkspeed, 325 runspeed) except models
[LUA]
function GM:PlayerSpawn( ply ) //What happens when the player spawns
self.BaseClass:PlayerSpawn( ply )
ply:SetGravity( 1 )
if ply:Team() == 2 then // If he is a survivor
ply:SetMaxHealth( 100, true )
ply:SetWalkSpeed( 275 )
ply:SetRunSpeed( 325 )
ply:SetModel( "models/player/group01/male_01.mdl" ) //Give him a human player model
elseif ply:Team() == 3 then // If he is a zombie
ply:SetMaxHealth( 200, true )
ply:SetWalkSpeed( 280 )
ply:SetRunSpeed( 335 )
ply:SetHealth(200) //i think you have to put this in
ply:SetModel( "models/player/classic.mdl" ) //Give him a zombie player model
end
end[/LUA]
[b][url=http://wiki.garrysmod.com/?title=Entity.SetHealth]Entity.SetHealth [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]
cubar got a buttpain again?
why is there ", true" in SetMaxHealth parameters? the only thing in there should be a number.
other then that, I don't see anything wrong with it.
[QUOTE=blown25;26461145][LUA]
function GM:PlayerSpawn( ply ) //What happens when the player spawns
self.BaseClass:PlayerSpawn( ply )
ply:SetGravity( 1 )
if ply:Team() == 2 then // If he is a survivor
ply:SetMaxHealth( 100, true )
ply:SetWalkSpeed( 275 )
ply:SetRunSpeed( 325 )
ply:SetModel( "models/player/group01/male_01.mdl" ) //Give him a human player model
elseif ply:Team() == 3 then // If he is a zombie
ply:SetMaxHealth( 200, true )
ply:SetWalkSpeed( 280 )
ply:SetRunSpeed( 335 )
ply:SetHealth(200) //i think you have to put this in
ply:SetModel( "models/player/classic.mdl" ) //Give him a zombie player model
end
end[/LUA]
[b][url=http://wiki.garrysmod.com/?title=Entity.SetHealth]Entity.SetHealth [img_thumb]http://wiki.garrysmod.com/favicon.ico[/img_thumb][/url][/b]
cubar got a buttpain again?[/QUOTE]
You're the one butthurt talking about it, lol, if you really want i got an rating blocker in javascript i'll give it to you so you can give people dumb rating or block ratings from people.
you just got a dumb rating, which shows it doesnt work...
Ok I put sethealth in, but I havent tested yet, what do I do to fix runspeed?
[QUOTE=Andriko1;26492075]you just got a dumb rating, which shows it doesnt work...
Ok I put sethealth in, but I havent tested yet, what do I do to fix runspeed?[/QUOTE]
What didn't work?
[lua] ply:SetHealth(number) [/lua]
:effort:
If this isn't in a gamemode folder, then it wouldn't work, anyway you need to change:
[lua]ply:SetMaxHealth( 100, true ) [/lua]
to
[lua]ply:SetHealth( 100 ) [/lua]
[lua]ply:SetMaxHealth( 200, true ) [/lua]
to
[lua]ply:SetHealth( 200 ) [/lua]
there is no reason for runspeed or walkspeed to not work
Regarding your SetWalkSpeed function, it probably works but you don't see any noticeable change because of the value you've set. The default is 250 and yours is 280... Try changing it to something huge like 2000 and check if it works.
Sorry, you need to Log In to post a reply to this thread.