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

Script will not work?

function clicked()
	game.StarterGui.ScreenGui.Frame.Mes.Text = "<efgde"
end
script.Parent.MouseButton1Down:connect(clicked)

Trying to make this script work, but it wont change the TextLabel(Mes) to efdge I have tried this in both a regular script and a localscript.

1 answer

✓ Accepted answer

If you want an immediate change, use PlayerGui, as StarterGui will just change the gui when you 'reset'.

Here's how you would do it in a LocalScript:

local plrgui = game.Players.LocalPlayer.PlayerGui

if plrgui ~= nil then --Just in case the player clicks too soon
	plrgui.ScreenGui.Frame.Mes.Text = "<efgde"
end

And in a Click script:

script.Parent.MouseButton1Down:connect(function()
	local plrgui = game.Players.LocalPlayer.PlayerGui

	if plrgui ~= nil then --Just in case the player clicks too soon
		plrgui.ScreenGui.Frame.Mes.Text = "<efgde"
	end
end)

If this helped please accept the answer :)

2 comments

0

Do I put both of those scripts in?

0

Well I was really just explaining it in the first one, but the second one will work if you put it in the TextButton.

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