This script gives me one coin when I touch it. I want to make another script that makes 1 part (part1) be taken after part2. is there a script for that? Mabe a wait until script.
script.Parent.Touched:connect(function(part)
if game.Players:findFirstChild(part.Parent.Name) then
local plr = game.Players:findFirstChild(part.Parent.Name)
plr.leaderstats.Coins.Value = plr.leaderstats.Coins.Value + 1
end
end)
local debounce = true
script.Parent.Touched:connect(function(part)
if debounce then
debounce = false
if game.Players:findFirstChild(part.Parent.Name) then
local plr = game.Players:findFirstChild(part.Parent.Name)
plr.leaderstats.Coins.Value = plr.leaderstats.Coins.Value
+1
script.Parent:destroy()
end
end
end)

2 comments
what should I name the parts
whatever you want in the variables.