Basically I'm trying to make it so that the text becomes bigger when the time reaches 10 and below, otherwize it won't make any other text bigger. For some reason it doesn't work and there isn't an error in the output.
local replicatedstorage = game:GetService("ReplicatedStorage") local status = replicatedstorage:WaitForChild("InfoValue") script.Parent.Text = status.Value while wait() do script.Parent.Text = status.Value local track = string.sub(script.Parent.Text, 1, 2) if script.Parent.Text == 'Game Over!' or 'Get Ready To Be Teleported!' or track == 'In' or script.Parent.Text == script.Parent.Name.Value..' has won the battle!' then script.Parent.TextSize = 25 elseif track <= 10 then for i = 1, 5 do wait(.1) script.Parent.TextSize = script.Parent.TextSize + 1 end for i = 1, 5 do wait(.1) script.Parent.TextSize = script.Parent.TextSize - 1 end end end
(All of my next answer is assuming that text is not scaled)
1. At line 8, you have or "Get Ready To Be Teleported!" which is not checking if the text matches anything. You need write out script.Parent.Text again so that the correct thing is being checked.
2. If track is ever less than 10, you are increasing the size of it by a very small amount, then shrinking it immediately back down.
3. Track is a string value consisting of the first 2 digits in the status' value. You would need to do if tonumber(track) whenever you are comparing track to a number value.
If there are still problems feel free to comment on my answer to tell me notice what I have mistaken on. Please remember to accept my answer if this has helped solve your problem.
'Get Ready To Be Teleported!' is defined only as a string followed by or
. This is not the proper way to use it in a If
statement.
Scripts that have a error will always stop and fail. This should be the solution.
Just put:
script.Parent.Text = 'Get Ready To Be Teleported!'
instead of 'Get Ready To Be Teleported!'
NOTE: THIS APPLIES TO and
ALSO!