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

i want to make game that when you have 100 point game end. why its not working? How to fix it?

Asked by
kiref81 -24
2 years ago
if game.Players.LocalPlayer.leaderstats.plus.Value + game.Players.LocalPlayer.leaderstats.minus.Value == 100 then
        game.StarterGui.ScreenGui.Finish.Visible = true
        game.StarterGui.ScreenGui.Frame.Visible = false
        game.StarterGui.ScreenGui.Finish.TextLabel.Text = game.Players.LocalPlayer.leaderstats.plus.Value
        if game.Players.LocalPlayer.leaderstats.plus.Value == 75-100 then
            game.StarterGui.ScreenGui.Finish.TextLabel.TextColor3 = blackgreen
        end
        if game.Players.LocalPlayer.leaderstats.plus.Value == 50-74 then
            game.StarterGui.ScreenGui.Finish.TextLabel.TextColor3 = gray 
        end
        if game.Players.LocalPlayer.leaderstats.plus.Value == 1-49 then
            game.StarterGui.ScreenGui.Finish.TextLabel.TextColor3 = red
        end
    end

1 answer

Log in to vote
0
Answered by 2 years ago

You can use :GetPropertyChangedSignal() to order to your own limit comes to be executed.

Code here:

local value = script.Parent.Value

value:GetPropertyChangedSignal("Value"):Connect(function()
    if value.Value == 100 then
        -- Add your code here!
    end
end)

Learn about this thing.

Ad

Answer this question