This script is suppost to be a part of a screen gui that makes a text label read how many player points it has, but I wanted to add if it got below a certain ammont, the text will change to a warning about how the player points are low. Then when it gets above that certain ammount, the message goes back to normal.
points = Game:GetService("PointsService") while true do wait(1) script.Parent.Text = "Available points: " ..Pointpoints:GetAwardables() .. "" if Pointpoints:GetAwardables() = <500 then script.Parent.Text = "Warning! Low on Points! Available points: " ..Pointpoints:GetAwardables() .. "" if Pointpoints:GetAwardables() = >501 then script.Parent.Text = "Available points: " ..Pointpoints:GetAwardables() .. "" if Pointpoints:GetAwardables() = 0 then script.Parent.Text = "No points! Available points: " ..Pointpoints:GetAwardables() .. "" end
first off, I would read this **wiki **page:
http://wiki.roblox.com/index.php?title=Player_Points
secondly, I would use the correct forms and variables for the loop.
Points = game:GetService("PointsService") while wait(1) do Awards = Points:GetAwardablePoints() if Awards < 500 then script.Parent.Text = "Warning, low points ["..Awards.."]!" else script.Parent.Text = "Awardable Points ["..Awards.."]" end end
ok, so what this does is set a variable "Points" to the PointsService on line 1. Then, it loops forever waiting every second on line 2. Then, it gets the available points to offer on line 3. If the points available is less than 500, (line 4), then change the text to a warning (line 5). Else, (if its not less than 500), then change it to a more suitable text (line 7)
The operators are >=
and <=
for larger than or equal to and less than or equal. Equality is ==
.
Note that you don't want to check both because at 500, both will occur.
You don't have end
s or use elseif
s on any of your conditions, so you don't have any properly defined blocks of code for any of the then
s.
While not wrong, appending ""
to the end of a string does nothing.