Hello,
I need some help here.
The code below is the code i'm using, and this is not working.
if SERVER then
local function Spawn(ply)
ply:Give("weapon_crossbow")
end
end
Did you put the code in the hook [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PlayerSpawn]GM/PlayerSpawn[/url] ?
Like this?
function GM:PlayerSpawn( ply )
ply:Give("weapon_crossbow")
end
The code above worked till I restarted the server.
Then the code wouldnt work anymore. ?
No, don't override gamemode functions unless you write your own gamemode.
use hooks instead!
[CODE]
hook.Add("PlayerSpawn", "GiveWeapons", function(ply)
ply:Give("weapon_crossbow");
end)
[/CODE]
Sorry, you need to Log In to post a reply to this thread.