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

Help with .Changed on a value?

I have the IntValue called "ShowTime" in Workspace and the value does change in another script. I am wanting the text to change to whatever the value is.

game.Workspace.ShowTime.Changed:connect(function()
	script.Parent.Text = game.Workspace.ShowTime.Value
end)

2 comments

0

Any errors?

0

No

1 answer

misinterpreted your question - this is a functioning script now. I have 2 solutions for u

game.Workspace.ShowTime.Changed:connect(function()
    script.Parent.Text = "" .. game.Workspace.ShowTime.Value
end)

first method uses string concatenation ( two dots operator ".." connects a string to a number value and results in a string)

game.Workspace.ShowTime.Changed:connect(function()
    script.Parent.Text = tostring(game.Workspace.ShowTime.Value)
end)

second method uses the tostring function to convert whatever is in the ()s to a string

3 comments

0

Use codeblocks.

1

sorry about that, didn't know codeblocks were a thing until right now! edited my post for you.

0

Also, this would be incorrect as you don't need to put Showtime.Value. The function already knows it's a value changing.

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