Hi im trying to make a script where a specific player can click a gui button (me) and itll freeze everyone (specifically making me sing and making them sleep) ive tried 2 methods and didnt work this took me 3 days trying to figure this out heres the script
local YuiiGui = game.Players.YuiiIsOld.PlayerGui
local Yuii = game.Workspace.YuiiIsOld
local Everyone = script.Parent
local SleepEvent = game.Workspace.SleepEvent
local FreezeEvent = game.Workspace.FreezeEvent
local StartFreeze = script.Parent.FreezeHandler
local YuiiHum = game.Workspace.YuiiIsOld.Humanoid
YuiiGui.YuiiIsOld.Frame.Sing.MouseButton1Click:Connect(function()
YuiiGui.YuiiIsOld.Frame.Visible = false
print("Singing!")
script.Lullaby:Play()
Yuii.Sing.Disabled = false
Yuii.Animate.Disabled = true
FreezeEvent:Play()
StartFreeze.Disabled = false
wait(8)
YuiiGui.YuiiIsOld.Frame.Sing.Visible = false
YuiiGui.YuiiIsOld.Frame.Visible = true
script.Lullaby:Stop()
Yuii.Sleep.Disabled = true
Yuii.Animate.Disabled = false
Yuii.Sing.Disabled = true
YuiiHum.WalkSpeed = 16
YuiiHum.JumpPower = 50
Everyone.Sleep.Disabled = false
Everyone.Animate.Disabled = true
wait(5)
Everyone.Sleep.Disabled = true
Everyone.Animate.Disabled = false
Everyone.FreezeHandler.Disabled = true
Everyone.FreezeHandler:Clone()
Everyone.FreezeHandler:Destroy()
wait(1)
YuiiGui.YuiiIsOld.Frame.Sing.Visible = true
end)
this is inside a local script located at StarterCharacterScripts the other script named FreezeHandler has this
if game.Workspace.FreezeEvent.Playing == true then
print("Successfully Frozen")
script.Parent.Humanoid.WalkSpeed = 0
script.Parent.Humanoid.JumpPower = 0
elseif game.Workspace.FreezeEvent.Playing == false then
script.Parent.Humanoid.WalkSpeed = 16
script.Parent.Humanoid.JumpPower = 50
end
the animation works dont worry, the walkspeed however wont change nor the jumppower

5 comments
I already tried this method, except with while wait() do its while true do, it did not work
*It still doesnt work with while wait() do either way
Just check whether the value of Playing is changing
If it is, then try using game.Players.LocalPlayer.Character.Humanoid.WalkSpeed and all
Yeah that was the thing i got wrong thank you