Answered by
5 years ago Edited 5 years ago
you're using local script, which is works only on "client" not on server, you better use remove events to make it work. The clone is not actually clone, it is just visual
try to do this >
create event named "WeaponEvent" and move it in repStorage
02 | local Event = game.ReplicatedStorage:WaitForChild( "WeaponEvent" ) |
07 | local ReplicatedStorage = game:GetService( "ReplicatedStorage" ) |
08 | local Event = ReplicatedStorage:WaitForChild( "WeaponEvent" ) |
10 | local function RWeapon(player) |
11 | Weapons = game.ReplicatedStorage.Weapons:GetChildren() |
12 | local Weapon = Weapons [ math.random( 1 ,#Weapons) ] :Clone() |
13 | Weapon.Parent = game.Players:FindFirstChild(player.Name).Backpack |
15 | Event.OnServerEvent:Connect(RWeapon) |