Why does this local script break certain weapons?
I have this code that assigns random weapons to a player from replicated storage, and it assigns the weapons just fine. Certain weapons however, just completely break when assigned. The weapons work perfectly fine until given through this script. Any help would be greatly appreciated, i've been trying to figure this out for about two weeks now.
01 | p = game.Players.LocalPlayer |
02 | repeat wait() until p:FindFirstChild( "Backpack" ) |
05 | repeat wait() until p:FindFirstChild( "Backpack" ) |
06 | game.ReplicatedStorage:GetChildren() [ math.random( 1 , #game.ReplicatedStorage:GetChildren()) ] :clone().Parent = p.Backpack |
07 | game.ReplicatedStorage:GetChildren() [ math.random( 1 , #game.ReplicatedStorage:GetChildren()) ] :clone().Parent = p.Backpack |
08 | game.ReplicatedStorage:GetChildren() [ math.random( 1 , #game.ReplicatedStorage:GetChildren()) ] :clone().Parent = p.Backpack |
11 | script.Parent.MouseButton 1 Click:connect(Click) |
``
Script location:
game.Workspace.Cstand2.Popup GUI.Classes.Main.Gambler.RandomWeapon