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

This resize script is supposed to make text bigger but it doesn't, any idea why?

Asked by 7 years ago

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
1
By chance is TextScaled true? lukeb50 631 — 7y
0
No, it isn't... Thelegendofglitcher2 49 — 7y

2 answers

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

(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.

0
Ive already tried to number so I'm going to define get ready to be teleported and see if it works. Thelegendofglitcher2 49 — 7y
0
I believe both of those combined will fix it. It did with my testing, but I had to change stuff, being as I made a countdown in FE, lol. RockerCaleb1234 282 — 7y
0
Welp I answered after you fixed your problem. User#18043 95 — 7y
0
Thanks guys for your answers, I fixed the problem. But I also have another one for you guys later. Thelegendofglitcher2 49 — 7y
Ad
Log in to vote
0
Answered by 7 years ago

'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!

Answer this question