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

Not being able to change text of a text label, button, box with script, Can someone help me?

Hello, I'm trying to make things with a GUI and it is not letting me change the text with a script. I made a little button that makes the text change when clicked and it should change, but it does not.

script.Parent.MouseButton1Click:Connect(function()
	script.Parent.Text = "hello"
end)

Any help would be greatly appreciated!!!

3 comments

1

Make it a LocalScript instead of a normal Script

0

LocalScript is unnecessary

0

wrong ^

2 answers

Use a local script instead of a script. Scripts run on the server while local scripts run on the client. If you're using a local script, ensure the script is not disabled.

1 comment

0

regular scripts can also access the PlayerGui, not just local scripts

script.Parent.MouseButton1Click:Connect(function()
	for _,p in pairs(game.Players:GetPlayers()) do
		p.PlayerGui.ScreenGui.TextButton.Text = "hello"
	end
end)

You don't need a LocalScript to accomplish this.

4 comments

0

yes you do lol, and you should be, but your script is wrong

0

it is not wrong

0

a server script can access the PlayerGui through this exact kind of script

0

but, i see your point: if FilteringEnabled is on, the PlayerGui cannot be accessed.

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