Random Item Giver Script?
Why won't this work? I want to give each player a random item on spawn.
Gives a random player an item when they spawn. Out of these four items. Rewrite the script if nessecary.
01 | game.Players.PlayerAdded:connect( function (plr) |
02 | plr.CharacterAdded:connect( function (chr) |
03 | local hk = Instance.new( "BoolValue" , plr) |
05 | hk.Name = "HoldingKnife" |
10 | local hum = chr:FindFirstChild( "Humanoid" ) |
12 | hum.Died:connect( function () |
19 | local o = math.random( 1 , 4 ) |
21 | local clone 1 = game.Lighting.Blade:Clone() |
22 | clone 1. Parent = plr.Backpack |
24 | local clone 2 = game.Lighting.Bombos:Clone() |
25 | clone 2. Parent = plr.Backpack |
27 | local clone 3 = game.Lighting.DualKnives:Clone() |
28 | clone 3. Parent = plr.Backpack |
30 | local clone 4 = game.Lighting.InsaneKnife:Clone() |
31 | clone 4. Parent = plr.Backpack |