Ok so basically when they touch it will give thema random weapon out of serverstorage but it wont work.
RespawnTime = 1200 Debounce = false script.Parent.Touched:connect(function (Hit) local HumanoidIsFound = Hit.Parent:FindFirstChild("Humanoid") local PlayerIsFound = game.Players:GetPlayerFromCharacter(Hit.Parent) if Hit.Parent and HumanoidIsFound and HumanoidIsFound.Health > 0 and PlayerIsFound then if not Debounce then Debounce = true local Weapon = game.ServerStorage(math.random()) if Weapon then local newWeapon = Weapon:Clone() newWeapon.Parent = PlayerIsFound.Backpack else Debounce = false return end wait(RespawnTime) Debounce = false end end end)
Your problem is here:
game.ServerStorage(math.random())
This syntax is invalid. I believe you are trying to do something along the lines of this
(game.ServerStorage:GetChildren())[math.random(1,NumWeapons)] --GetChildren creates a table of all Children inside ServerStorage, and then with the [] syntax we can access values of that table by their index.