#why wont my number update?

50 messages · Page 1 of 1 (latest)

weary forum
#

show code

true lynx
#

ok

#
while true do
    script.Parent.Text = game.Workspace.ValuesDoor50.Code.Digit2.Value
    wait(0.1)
end
#

@weary forum

#

valuesdoor50 is a folder, and code is also a folder

weary forum
#

Why is it in a while true loop?

true lynx
#

well, it's to always update the text

#

because the number changes

#

is it supose to be in a different type of loop?

weary forum
#

Well, where is the text label and where is the value

#

located

true lynx
#

the text label and the values are both located in workspace

#

it works on a screenGUI but not on a surfaceGUI

true lynx
weary forum
#

Well last question, does the text update once, or does it not even update?

true lynx
#

it doesn't, it just stays as the base text (aka the one i put in studio)

weary forum
#

can you show me the explorer

true lynx
#

ok

eager kraken
#

Maybe you could try this?
while wait() do
script.Parent.Text = game.Workspace.ValuesDoor50.Code.Digit2.Value
end

true lynx
#

ok but it times the script out

#

can i put 0.1 in the wait brackets?

#

so that the script doesnt timeout

eager kraken
#

ofc

true lynx
#

lemme try

#

it works!

eager kraken
#

great!

true lynx
#

lemme see if it works with another thing

eager kraken
#

k, i hope it does!

true lynx
#

hm, it doesnt

eager kraken
#

what didnt work?

true lynx
#

the script is

local digits = game.Workspace.ValuesDoor50
local digitscode = digits.Code
local digitsvalues = digits.Values
local digit1 = digitscode.Digit1
local digit2 = digitscode.Digit2
local digit3 = digitscode.Digit3
local circle = digitsvalues.Circle
local square = digitsvalues.Square
local triangle = digitsvalues.Triangle
while wait(0.1) do
    if digit1.Value == circle.Value and digit2.Value == square.Value and digit3.Value == triangle.Value then
        script.Parent.Parent.Model.door:Destroy()
    end
end
#

and this is the explorer

eager kraken
#

ok

#

let me think

true lynx
#

also

eager kraken
#

I'm sorry but, I don't think I know how to solve this. I'm not an advanced scripter, sorry.

true lynx
#

maybe it worked with the while loop

#

while true loop*

eager kraken
#

maybe

#

bc rn, it's checking every 0.1 second

#

idk if that matters

true lynx
#

oh

#

it worked with the while true loop

eager kraken
#

great

vague needle
#

studio** You are now Level 1! **studio

true lynx
#

still, thanks for the script so that the numbers update!

vague needle
#

studio** You are now Level 5! **studio

true lynx
#

ok i will delete this post now