Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.