local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse() Mouse.KeyDown:connect(function(key) if key == "q" then local backpack = game.Players.LocalPlayer.Backpack local Slice1 = game.ReplicatedStorage.Slam:Clone() Slice1.Parent = backpack end end)
Every time I click q I get the hopperbin I need but I also end up getting around 10 of them instead of just 1. This script clones a Hopperbin named "Slam" and puts it in my Backpack. How do I stop it from cloning lots of Hopperbins and only 1
Hmm. You should check if someone already has the hopperbin.
local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse() Mouse.KeyDown:connect(function(key) if key == "q" then local backpack = game.Players.LocalPlayer.Backpack local Slice1 = game.ReplicatedStorage.Slam:Clone() if Slice1.Parent == backpack then print("User already has Slice1!") else Slice1.Parent. = backpack wait(0.5) -- Added that just in case. end end end)
There's the revised script. If this helped, be sure to upvote/accept the answer! c;