Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why is my label gui not updating using variables?

i am trying to make a easy script that tells you how many parts you spawned in the world. but it only says "parts = 1" and doesn't update. why is dat

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.5)
	texts.Text = "parts = "..number
	wait(0.5)
	number = number+1
	
end

1 answer

✓ Accepted answer

The loop only runs when the number is above 50, this can be fixed by changing the loop to just run all the time.


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

while wait(0.5) do
    Instance.new("Part",workspace)
    print(g,number)
    texts.Text = "parts = ".. number
    number = number+1
end

Also I’ve seen that you’ve posted this code multiple times, try keeping this to one question, and adding extra comments for things that you need.

1 comment

0

but it still doesn't udpate

This discussion is preserved as it was. New answers, comments, and votes are closed.