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

How do I make a script stop running with another script?

Asked by 8 years ago

How do I make a script stop running with another script?

1 answer

Log in to vote
0
Answered by 8 years ago

when you step on a brick to buy:

bought = false
script.Parent.Touched:connect(function(hit)
    if hit.Parent:findFirstChild("Humanoid") then

        if game.Players:GetPlayerFromCharacter(hit.Parent).leaderstats.gold.Value >= 100 and bought == false then
            bought = true
         game.Players:GetPlayerFromCharacter(hit.Parent).leaderstats.gold.Value = game.Players:GetPlayerFromCharacter(hit.Parent).leaderstats.gold.Value-100    
            workspace.Wall:Remove()
        end
    end
end)

`

Ad

Answer this question