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

Title updater working in the studio, but not in-game? [SOLVED]

Hi there! I'm having an issue with my game title updater. It's supposed to refresh the text at the top of the screen so you know what's going on, like the intermission and so on. The updater works perfectly in the studio, but when I test it on the actual Roblox platform in-game, it returns with the error message: attempt to call userdata value. I have tried putting a delay on the function so it gives a little time for the player to join in before it starts running, but it doesn't seem to work. Here is the code below:

game("GetService","RunService").RenderStepped:connect(function()
	ui:WaitForChild("Title").Text = game.Workspace.Game.Stats.Status.Value
end)

A couple things:

-The ui is the ScreenGui that holds the text.

-The game.Workspace.Game.Stats.Status.Value is the value that you can change to change the text at the top of the screen.

If someone could take a look at this and help, that would be greatly appreciated!

3 comments

0

That is a deprecated form of reference, frankly I’m shocked to see it. Use game:GetService("RunService") instead. Or, optionally connect a GetPropertyChangedSignal to the Status Value and load in the new Text this way.

0

Thank you so much! I have been wrestling with this problem for a long time! Can you please put that comment as an answer so I can give you credit?

0

Ha, thank you!

1 answer

✓ Accepted answer

That is a deprecated form of reference, frankly I’m shocked to see it. Use game:GetService("RunService") instead. Or, optionally connect a GetPropertyChangedSignal to the Status Value and load in the new Text this way.

local Status = workspace.Game.Stats.Status

Status:GetPropertyChangedSignal("Value"):Connect(function(Changed)
    print(Changed)
end)

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