so I'm trying to make a ButtonGui that when pressed will give a gun (clone) to the LocalPlayer but, the problem is that it cloned 2 times (i think) and ended up like this (2 of the same gun in the backpack) https://gyazo.com/23740e9dd6dec07ab059052eaefc4cd5
these are my scripts
--server script
local famas = game.ReplicatedStorage.FAMAS
local scarL = game.ReplicatedStorage["SCAR-L"]
local remote = Instance.new("RemoteEvent")
remote.Parent = game.ReplicatedStorage
remote.Name = "WeaponEvent"
local active = game.StarterGui.Activated.Value
local playerName;
print("weaponscript test")
game.Players.PlayerAdded:Connect(function(player)
playerName = player.name
end)
remote.OnServerEvent:Connect(function()
wait(1)
print(playerName .. " Is name")
local famasClone = famas:Clone()
famasClone.Parent = game.Players[playerName].Backpack
active = false
print("weaponscript activated")
end)
.
--Local script
local button = script.Parent
local weaponRemote = game.ReplicatedStorage:WaitForChild("WeaponEvent")
button.MouseButton1Click:Connect(function()
weaponRemote:FireServer()
end)
can anyone help?

2 comments
Use FindFirstChild to check if the player does not have a weapon. If they don’t, then clone and parent the weapon to their backpack.
Don't forget to accept my answer if it solves your problem