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

How do I fix this other team change button script in my team change GUI?

Asked by 3 years ago

The purpose of this script is that, if a player has 50 dollars, it will remove 5o dollars from them and team them to the civilian team, then reset them. if they don't have 5o dollars, it gives an 'insufficient funds' message.

local plr = game.Players.LocalPlayer

if plr.leaderstats.Money.Value <= 50 then

    script.Parent.MouseButton1Click:Connect(function()
        plr.leaderstats.Money.Value = plr.leaderstats.Money.Value-50
        plr.TeamColor = BrickColor.new("Bright blue")
        wait(1)
        plr.Character.Humanoid.Health = 0
    end)

else
    script.Parent.MouseButton1Click:Connect(function()
    game.StarterGui.InsufficientFunds.TextLabel.Visible = true
    wait(5)
    game.StarterGui.InsufficientFunds.TextLabel.Visible = false
end)
0
Just noticed i used a less than symbol instead of a greater than symbol, fixed it. Mobzillaz 0 — 3y

Answer this question