How do i make a this script only give gear one time

Try this out?

game.ReplicatedStorage:WaitForChild("PickupItem").OnServerEvent:Connect(function(player, item, itemMins)
	local itemname = item.Parent.Name
	if player:WaitForChild("Data").Minutes.Value >= itemMins and not player.Backpack:FindFirstChild(itemname) and not player.Character:FindFirstChild(itemname) then
		local newItem = item.Parent:Clone()
		newItem.Parent = player.Backpack
		newItem.Handle.Anchored = false
	else
		player.PlayerGui.ScreenGui.Error.Visible = true
		wait(0.5)
		player.PlayerGui.ScreenGui.Error.Visible = false
		print(itemMins)
		print(item.Name)
	end
end)

Nevermind… didn’t scroll over in @JackscarIitt 's script.

Your using item.Parent:Clone() so I’m assuming the script is inside the tool. Everytime you fire this event it creates another tool with the same script inside. The first time you call the function you will get 1 tool and the second time you run it you will get 2 because there’s two scripts listening for the event. Try putting the script somewhere that’s not in the tool

1 Like

Inhale
I don’t think that’d matter anyways, finding the Tool on both the Player’s Character/Player’s Backpack or the StarterGear would still have the same result regardless