You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I want to know/have a script which checks if a gui is enabled, and if it is, the player cannot move. and if the gui isn’t enabled, they can move.
What is the issue? Include screenshots / videos if possible!
I don’t know how to achieve it, and i cannot figure it out.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have tried using Disable() and Enable() by the PlayerControls module, but it doesn’t enable again. I have also used the Humanoid.WalkSpeed thingy and changing it when it isn’t enabled or is enabled, but broke. This may be because I have changed the default walkspeed in StarterPlayer, but I don’t know.
This is my current Humanoid walkspeed script:
local defWalkSpeed = 23
local plr = game.Players.LocalPlayer
local char = plr.Character
local huma = char.Humanoid
local gui = plr.PlayerGui.LoadingScreen
while true do
if gui.Enabled == true then
huma.WalkSpeed = 0
else
huma.WalkSpeed = defWalkSpeed
script:Destroy()
end
wait(0.5)
end
local defWalkSpeed = 23
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local Gui = Player.PlayerGui.LoadingScreen
Gui:GetPropertyChangedSignal("Enabled"):Connect(function()
if gui.Enabled then
Humanoid.WalkSpeed = 0
else
Humanoid.WalkSpeed = defWalkSpeed
end
end)
i see script named LoadingScreenConfig i guess it is what enabling and disabling loading screen right?
if so then just change character walk speed inside that script
Put this in StarterGui. [That mean just change script to this]
local defWalkSpeed = 23
local Player = game.Players.LocalPlayer
local Character = Player.Character
local Humanoid = Character:WaitForChild("Humanoid")
if not Humanoid then retturn end
local Gui = Player.PlayerGui.LoadingScreen
Gui:GetPropertyChangedSignal("Enabled"):Connect(function()
if Gui.Enabled then
Humanoid.WalkSpeed = 0
else
Humanoid.WalkSpeed = defWalkSpeed
end
end)
local defWalkSpeed = 23
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local Gui = Player.PlayerGui.LoadingScreen
Gui:GetPropertyChangedSignal("Enabled"):Connect(function()
if Gui.Enabled then
Humanoid.WalkSpeed = 0
else
Humanoid.WalkSpeed = defWalkSpeed
end
end)
task.wait()
local defWalkSpeed = 23
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local Gui = Player.PlayerGui.LoadingScreen
if Gui.Enabled then
Humanoid.WalkSpeed = 0
end
repeat task.wait() until Gui.Enabled = false
Humanoid.WalkSpeed = defWalkSpeed