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

What's wrong with this simple script?

What's wrong with this script? It's suppose to make a welcoming label for a player that just joined the server. I can't change the label.

Local replicatedstorage = game:GetService('ReplicatedStorage')
Local status = replicatedstorage:WaitForChild('InfoValue')
script.Parent.Text = status.Value
status.Changes.connect(function()
script.Parent.Text = status.Value
end)

I put this script inside a Local Script that's inside a Text Label thats inside the ScreenGui thats inside the starter gui. When I change the value using the info value(inside ReplicatedStorage) it doesn't change the label.

2 comments

0

Put it in a code block.

0

Edited to put in code block

2 answers

Local replicatedstorage = game:GetService('ReplicatedStorage')
Local status = replicatedstorage:WaitForChild('InfoValue')
script.Parent.Text = status.Value
status.Changed.connect(function()
	script.Parent.Text = status.Value
end)

The problem is that you wrote status.Changed, but you need status.Changed because this is the real event name and the value was changed and is not changing.

1 comment

0

Don't forget to accept this as answer if it helped.

It is

status.changed:connect(function(...

When you use connect, you have to use a colon(:).

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