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

SurfaceGui TextButton script not opening another GUI, why?

Asked by 6 years ago

On one of the walls of a house I have built in my game there is a TextButton that says "House Information". When you click it, it is supposed to bring up a ScreenGui that gives information about the house. For whatever reason, it is not doing this. Does anyone know why?

script.Parent.MouseButton1Click:connect(function()
    game:GetService("Players").LocalPlayer.PlayerGui.CommonHouseInfo.Frame.Visible = true
end)

1 answer

Log in to vote
0
Answered by 6 years ago

I think this should work. The screenGUI I put in, change to the name of yours. Insert a local script into the StarterGUI it should say:

game.StarterGUI.TextButton.MouseButton1Click:connect(function()
game.StarterGUI.ScreenGUI.CommonHouseInfo.Frame.Visible = true

tell me if it's wrong, I'm doing something similar soon.
Bye

Ad

Answer this question