local re = game:GetService("ReplicatedStorage") local gun = re:WaitForChild("GunOne") local player = game.Players.LocalPlayer script.Parent.MouseButton1Down:connect(function() local clonedgun = gun:Clone() clonedgun.Parent = player.Backpack end)
Since you are using a LocalScript, you should use your variable, "player" aswell as identify the player's mouse in order to trigger an event.
local re = game:GetService("ReplicatedStorage") local gun = re:WaitForChild("GunOne") local player = game.Players.LocalPlayer local m = player:GetMouse()
m.Button1Down:connect(function(m) local clonedgun = gun:Clone() clonedgun.Parent = player.Backpack end)