I've made a few ScreenGui"s" and when you click on something the Gui will appear and it works in the studio but not In-Game
Here is my script :
local function click (player) player.PlayerGui.ScreenGui.Frame.Visible = true end script.Parent.ClickDetector.mouseClick:connect(click)
Is there anything wrong with the script that makes it not appear in the game?
I'd be pleased if someone tells me what's wrong with the script.
I'll thank you in advance if you tell me.
local Button = script.Parent Frame = script.Parent.Parent.Frame function onClick() if Frame.Visible == false then Frame.Visible = true elseif Frame.Visible == true then Frame.Visible = false end end Button.MouseButton1Click:connect(onClick)
This is a code where you Open/Close the Frame you want, if you want just to open it when you click, delete lines 7-9. However, if you want just to close it delete lines 5-6 and one of the end's at the end. Make sure this script is into a textButton, which textButton is into the frame you're want to close/open. Accept this answer if this worked please, to help me.
mouseClick
, which is deprecatedMouseClick
GuiObject
on the serverRemoteEvent
to the client (FE compatible as bonus!)click (player)
click(player)
Connect
, as ROBLOX has plans to remove connect
.