Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why do I get so much hopperbins?

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

1 comment

1 answer

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;

2 comments

0

It doesnt seem to work, it just gives the slam tool ever 0.5 seconds.

0

I didnt downvote btw

This discussion is preserved as it was. New answers, comments, and votes are closed.