TextLabel Won't Update On IntValue Changed

i have a textlabel and it displays the value on the text but it wont update

local val = workspace.Values.FloorValue
local label = script.Parent

label.Text = "floor: "..val.Value

val.Changed:Connect(function()
	label.Text = "floor: "..val.Value
end)

Are there any errors? What kind of script is this? Where is this script located?

sorry for the laziness on my end

its a regular script and its a child of the label and its located in startergui

What kind of script is updating the value?

as i said before in my previous comment, its a regular script

I am referring to the script that modifies the IntValue, not the script modifying the TextLabel.

oh my bad, i haven’t worked on it yet

I’m just modifying it in the properties tab by running it

@mapleflavouredk9 The script is cloned with the Gui too. OP is using relative pathing to the TextLabel, they are not referencing the label in StarterGui directly. Also, RemoteEvents are unnecessary since you can simply listen to the Changed event of Value instances.


@Hanadtv Are you modifying in client or server mode?

could you explain to me what is the difference

In client mode, any changes made in the Properties window will not replicate to the server scripts and other clients. Server mode, on the other hand, will replicate all changes to server scripts and all clients.

i switched to the server and it’s still not updating :pensive:

Are you receiving any errors in the Output window?

no i’m not getting any errors in the output

if this helps this is a picture of my studio and im running it on server

From the image you have displayed, the FloorValue is a IntValue and you can’t put a number into a string unless you convert the number into string format:

local val = workspace.Values.FloorValue
local label = script.Parent

label.Text = "floor: ".. tostring(val.Value)

val:GetPropertyChangedSignal("Value"):Connect(function()
	label.Text = "floor: "..tostring(val.Value)
end)

this didn’t work either

i’m gonna check to see if there is another script messing it up

i changed the script to run on the server and it worked

and the script i wrote down works as well but i’m just going to steal your script

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.