I have a part that opens a gui, then a button inside that gui which closes it. It opens the first time, then doesn’t open the second time after I close.
Script inside part:
local part = script.Parent local players = game:GetService("Players") local function opengui(player) player.PlayerGui.RebirthGUI.MainFrame.Visible = true end part.Touched:Connect(function(hit) local char = hit.Parent local player = players:GetPlayerFromCharacter(char) local hum = char:WaitForChild("Humanoid") print(player) opengui(player) hum.WalkSpeed = 0 end)
Script inside Button:
local btn = script.Parent local gui = script.Parent.Parent local player = game.Players.LocalPlayer local char = player.Character local hum = char:WaitForChild("Humanoid") btn.MouseButton1Click:Connect(function() gui.Visible = false hum.WalkSpeed = 16 end)
This is what I usually do and it works, is there any reason it isn’t now?