Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make a certain amount of tool clone?

Asked by
A_quib -3
2 years ago

You know, you can make a tool clone by using tool:Clone() and what I'm trying to do is like everytime you touch a part it clones a tool and gives you it. But when I touch the part it like clones the tool like 9-10 times and gives it to me but I want the tool to clone only one time and then make it give the tool clone to me.

3 answers

Log in to vote
0
Answered by 2 years ago

Just make the .Touch part checks if player already has the item then clone if not

Ad
Log in to vote
0
Answered by
Xyternal 247 Moderation Voter
2 years ago
Edited 2 years ago

So your problem is simple. All you need to do is add a little debounce. Sample code is below.

local debounce = true
part.Touched:connect(function()
if debounce then
debounce = false
print("hi")
wait(2)
debounce = true
end)


Log in to vote
0
Answered by 2 years ago

This is very simple to fix. You can either use debounce or wait. They should both easily fix this issue.

Answer this question