Random Spawn Weapon

Can anyone quick code me a small serverside script, I want it to spawn somebody with a weapon, using mathrandom. that would be awesome :slight_smile: THANKS IN ADVANCE!


local WEAPONS = {

function RandomLoadout(pl)
pl:Give(WEAPONS[math.random(1, #WEAPONS)])
hook.Add(“PlayerLoadout”, “LoadRandomLoadout”, RandomLoadout)

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.