Hello, I try to make something like game paused feature. All works, when you click the Pause button your charcter stop moving and you have a little menu with a Play button. When I click Play I can move again but the Pause button don’t come back.
I m really bad at scripting so it maybe obvious why it don’t work so if some can fix my script
local frame = script.Parent.Parent.Frame
local open = script.Parent
local player = game:GetService("Players").LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local RootPart = character:WaitForChild("HumanoidRootPart")
open.MouseButton1Click:Connect(function()
frame.Visible = not frame.Visible
RootPart.Anchored = frame.Visible
end)
--Pause button--
local frame = script.Parent.Parent.Frame
local close = script.Parent
local player = game:GetService("Players").LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local RootPart = character:WaitForChild("HumanoidRootPart")
local open = player.PlayerGui.PauseGame.PauseButton
open.MouseButton1Click:Connect(function()
frame.Visible = not frame.Visible
open.Visible = not frame.Visible
RootPart.Anchored = frame.Visible
end)
--Play button--
local frame = script.Parent.Parent.Frame
local open = script.Parent
local player = game:GetService("Players").LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local RootPart = character:WaitForChild("HumanoidRootPart")
open.MouseButton1Click:Connect(function()
frame.Visible = not frame.Visible
open.Visible = not frame.Visible
RootPart.Anchored = frame.Visible
end)
--Pause button--
local frame = script.Parent.Parent.Frame
local close = script.Parent
local player = game:GetService("Players").LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local RootPart = character:WaitForChild("HumanoidRootPart")
local open = player.PlayerGui.PauseGame.PauseButton
close .MouseButton1Click:Connect(function()
frame.Visible = not frame.Visible
open.Visible = not frame.Visible
RootPart.Anchored = frame.Visible
end)
--Play button--
local frame = script.Parent.Parent.Frame
local open = script.Parent
local player = game:GetService("Players").LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local RootPart = character:WaitForChild("HumanoidRootPart")
open.MouseButton1Click:Connect(function()
frame.Visible = not frame.Visible
open.Visible = not frame.Visible
RootPart.Anchored = frame.Visible
end)
I used to have the same issue. I’m not sure if this would help you.
Try to change the “local open: game.StarterGui.PauseGame.PauseButton”
to “local open: script.Parent.Parent.Parent.PauseButton”
Again I’m not sure if this is going to help, But I used to have the same issue, and I fixed it by doing that.