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

UPDATED: SurfaceGui Button Click Opens ScreenGui doesn't work in-game but does in studio?

Asked by 7 years ago

This is the code:

script.Parent.MouseButton1Click:connect(function()
    local plr = game:GetService("Players").LocalPlayer
    plr.PlayerGui.ScreenGui.Frame1.Visible = true
end)

It works well in studio but it does not work in game.

The error says: Workspace.MainSreen.SurfaceGui.HackButton.Script:3: attempt to index local 'plr' (a nil value)

Can anyone help? Thank you!

This is inside a normal script, which is inside a SurfaceGui TextButton.

If you would like to contact me to go check it out in team create, please tell me.

0
You need to put it in a local script as it is handling guis. Unless you want to use remote event DeveloperSolo 370 — 7y
0
Okay I will try that. TSK_Uncovered 55 — 7y
0
Did it work? DeveloperSolo 370 — 7y
0
No it didn't. If you would like, I could invite you to a team create to check it out. TSK_Uncovered 55 — 7y

Answer this question