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

Why doesnt this change in game?

Why isnt this working???

function onClicked()
	game.StarterGui.Scoreboard.Frame.Away.Text = script.Parent.ORL.Name
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)

1 answer

✓ Accepted answer

The GUI a player sees is not inside of StarterGui. StarterGui is the GUI's that become given to a player when they join the game. The given GUI's are then put inside of the Players PlayerGui which is what they actually see. So to fix this, you want to get the GUI inside of the Players PlayerGui instead.

First, I'll let you know that ClickDetector's MouseClick gives you the player that has clicked, now we know who did it, so we can change their GUI. Look bellow for the functional script and some commenting on what is happening.

function onClicked(PlayerThatClicked) -- This can be anything, it can just be Player if you'd want.
    PlayerThatClicked.PlayerGui.Scoreboard.Frame.Away.Text = script.Parent.ORL.Name -- get THEIR Gui
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

If this works and helped you, please accept the answer, if it does not then comment, you can comment any questions too and I'll answer as well.

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