How would I make an if then statement that checks if the localplayers points are equal to or greater than 120?
I tried this:
script.Parent.MouseButton1Down:connect(function(GUI) if game.Players.LocalPlayer.leaderstats.Points >= 120 then game.Players.LocalPlayer.leaderstats.Points.Value = game.Players.LocalPlayer.leaderstats.Points.Value - 120 game.Players.LocalPlayer.sONE.Value = true script.Parent.Parent.psorisf.TextLabel.Text = "Purchase complete!" wait(2) script.Parent.Parent.psorisf.TextLabel.Text = "" elseif game.Players.LocalPlayer.sONE.Value < 120 then script.Parent.Parent.psorisf.TextLabel.Text = "Insufficient funds!" wait(2) script.Parent.Parent.psorisf.TextLabel.Text = "" end end)
But it says in the output tried to do arithmetic on a player value or something, I need it to check if it IS EQUAL to or greater than 120, not make it equal to or greater than 120. Is there some operator like >==? I know that isn't but is there something like that?
script.Parent.MouseButton1Down:connect(function(GUI) if game.Players.LocalPlayer.leaderstats.Points.Value >= 120 then game.Players.LocalPlayer.leaderstats.Points.Value = game.Players.LocalPlayer.leaderstats.Points.Value - 120 game.Players.LocalPlayer.sONE.Value = true script.Parent.Parent.psorisf.TextLabel.Text = "Purchase complete!" wait(2) script.Parent.Parent.psorisf.TextLabel.Text = "" elseif game.Players.LocalPlayer.sONE.Value < 120 then script.Parent.Parent.psorisf.TextLabel.Text = "Insufficient funds!" wait(2) script.Parent.Parent.psorisf.TextLabel.Text = "" end end)
What you did wrong is on line 2, you for got the ".Value" next to Points.