Need Help with script for game


  • Hi does anybody know a code that would make a block be taken before another one.. I have a script that games me one coin but i need a script that makes it so I have to get one block before another.

    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)


  • anybody?


  • @ootheboss Use an if statement to check if the previous part been taken. Also, this looks like a free model, so don't use that.

Log in to reply
 

Looks like your connection to Scripting Helpers was lost, please wait while we try to reconnect.