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

Script will not work?

Asked by 11 years ago
1function clicked()
2    game.StarterGui.ScreenGui.Frame.Mes.Text = "<efgde"
3end
4script.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

Log in to vote
2
Answered by 11 years ago

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:

1local plrgui = game.Players.LocalPlayer.PlayerGui
2 
3if plrgui ~= nil then --Just in case the player clicks too soon
4    plrgui.ScreenGui.Frame.Mes.Text = "<efgde"
5end

And in a Click script:

1script.Parent.MouseButton1Down:connect(function()
2    local plrgui = game.Players.LocalPlayer.PlayerGui
3 
4    if plrgui ~= nil then --Just in case the player clicks too soon
5        plrgui.ScreenGui.Frame.Mes.Text = "<efgde"
6    end
7end)

If this helped please accept the answer :)

0
Do I put both of those scripts in? My_Comment 95 — 11y
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. systematicaddict 295 — 11y
Ad

Answer this question