Walkspeed, runspeed, loadout and playerhasspawned

I am quite new to lua, I decided as a first project to make a simple deathmatch gamemode. I have a few questions.

  1. Can I use ply:SetRunSpeed and ply:SetWalkSpeed in GM:PlayerLoadout?
  2. Will this code work?
    [lua] function GM:PlayerLoadout( ply )

if ply:Team() == 1 then

ply:Give( "weapon_physcannon" )
ply:SetModel( "models/player/kleiner.mdl" ) 
ply:Give( "item_battery", 5 ) 
ply:SetRunSpeed(1000) [/lua]

Why don’t you try?

Thanks for all the help. [/sarcasm]

Most likely that won’t work. Set the runspeed and model on PlayerInitialSpawn and give in the loadout.


Thank you.

Actually it would work that way too, just preference.

Putting an ‘end’ at the end of functions, loops, and if statements usually makes it work better

That was copy pasted from my init.lua, there were other team "if"s.