Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

What's wrong with this simple script?

Asked by 8 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

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.

0
Put it in a code block. M39a9am3R 3210 — 8y
0
Edited to put in code block BlueTaslem 18071 — 8y

2 answers

Log in to vote
0
Answered by
pk008 15
8 years ago

It is

status.changed:connect(function(...

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

Ad
Log in to vote
0
Answered by
Wutras 294 Moderation Voter
8 years ago
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.

0
Don't forget to accept this as answer if it helped. Wutras 294 — 8y

Answer this question