This script gives me one coin for the block. I want to make it where one block is on top of the other and the top one has to be taken before the Bottom one.
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)

3 comments
Where are the bricks located in regards to the script? And what are their names?
oh should I change the name name
the last end's a red line under it