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

My script that would enable a GUI wont work i don't know whats wrong no output?

Asked by
danglt 185
5 years ago
local Button = script.Parent

Button.MouseButton1Click:connect(function(p)
    game.Players.LocalPlayer.PlayerGui.Rooms.Enabled = true
end)
0
Just to clarify, this is on the client, correct? Also, please elaborate more if you can. Lugical 425 — 5y

1 answer

Log in to vote
0
Answered by
Lugical 425 Moderation Voter
5 years ago

Assuming that this script is in a UI on the client, the only real issue I see here is that Enabled can occasionally work funny. If you do have a frame holding all of it, I would instead turn the visibility of the frame to true so it could be seen.

local Button = script.Parent

Button.MouseButton1Click:Connect(function(p) --Use :Connect, :connect isn't a good practice.
    game.Players.LocalPlayer.PlayerGui.Rooms.Frame.Visible = true
    -- If you don't have a frame, place a frame with size {1,0}, {1,0} and place the rest of the UI in there. Note that if you have other scripts relating to this GUI, you might need to alter them.
end)

Hopefully this helps! If the problem persists, please let me know so I can see what else I can do.

0
U can replace true with not game.Players.LocalPlayer.PlayerGui.Rooms HappyTimIsHim 652 — 5y
Ad

Answer this question