Can anyone quick code me a small serverside script, I want it to spawn somebody with a weapon, using mathrandom. that would be awesome :) THANKS IN ADVANCE!
noone?
[lua]
local WEAPONS = {
"weapon_crowbar",
"weapon_pistol",
"weapon_shotgun"
}
function RandomLoadout(pl)
pl:Give(WEAPONS[math.random(1, #WEAPONS)])
end
hook.Add("PlayerLoadout", "LoadRandomLoadout", RandomLoadout)
[/lua]
This is serverside.
Replace the values in the table with the names of the weapons you want the player to have a chance of getting.
Sorry, you need to Log In to post a reply to this thread.