The title may have been confusing, so I'm sorry, but I'm trying to make a dialog gui from scratch (I'm new to scripting, I'm trying to make things myself so I can understand how they work) and you have to click a player to enable the gui. It works once, I can click the player, it enables the gui, I click the close button, and it closes. When I click the player after that, It doesn't get enabled. I'm not sure what to do about it.
script.Parent.MouseClick:Connect(function(player) player:WaitForChild("PlayerGui").dialog.Enabled = true player.Character.Humanoid.WalkSpeed = 0 player.Character.Humanoid.JumpPower = 0 print("open"); end)
^^^ The code to enable the gui
vvv The code used to close the gui
script.parent.op3.MouseButton1Click:connect(function(player) game.Players.LocalPlayer.PlayerGui.dialog.Enabled = false game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16 game.Players.LocalPlayer.Character.Humanoid.JumpPower = 50 print("close"); end)
The "print("open");" still prints after the first time closing even though it doesn't get enabled.
Thank you in advance to anyone who responds.