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

I am not understanding why my loop is not outputting anything taking in the factthatitshouldbework ?

Asked by 4 years ago
Edited 4 years ago

This loop doesn't output anything

local g = "Times"
local number = 1
local texts = game.StarterGui.ScreenGui.TextLabel

while number < 50 do
    Instance.new("Part",workspace)
    print(g,number)
    wait(0.2)
    number = number+1   
end

while true do                --THIS LOOP
    print("works")
    texts.Text = "parts =", tostring(number)  --use tostring
    wait(1)
end
0
Have you tried using while true do? Or RunService.Stepped? Nckripted 580 — 4y
0
here is the original script with while true and still doesn't output HeroFigo 81 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago

Your script isnt running at all!!!!!!!!!!!

I suspect it is a LocalScript, and if so, note that they only run inside either the Player, the Character, or inside the Player Service. If they are not parented to any of them, they won't budge at all

0
bcaon fries Windsonnes 75 — 4y
0
actually! the problem was that the script was in the workspace and not inside the gui it's self so the script was changing the server's gui not the copy that the player got. anyway ima accept your answear when you respond HeroFigo 81 — 4y
Ad
Log in to vote
0
Answered by
OhManXDXD 445 Moderation Voter
4 years ago

You cannot run 2 while loops in the same script. You have to find a different way to run both of those loops.

0
still doesn't work HeroFigo 81 — 4y

Answer this question