I have my gun in ReplicatedStorage and a simple script in a GUI which when you press, the gun gets cloned and transferred to your backpack. The script works but when I equip the gun it doesn't work at all but if I directly put the gun in the StarterPack and play, it works perfectly fine. I have no idea how to fix this and have searched online and found nothing.
Here is the GUI Script:
local tool = game.ReplicatedStorage.Musket local player = game.Players.LocalPlayer script.Parent.MouseButton1Click:Connect(function() tool:Clone() tool:Clone().Parent = player.Backpack end)
Try making a Remote Event and making the script fire it.
local tool = game.ReplicatedStorage.Musket local player = game.Players.LocalPlayer local event = game.ReplicatedStorage.Clone --Name the event that script.Parent.MouseButton1Click:Connect(function() event:FireServer() end)
My bad. Actually just make a server script in serverscriptservice and use the following code
game.ReplicatedStorage.Clone.OnClientEvent:Connect(Function(player) local b = game.ReplicatedStorage.Musket:Clone() b.Name = "Musket" b.Parent = player.Backpack end)