local sound = workspace["Time Stop"]
local sound2 = workspace["Jumpscare sound effect"]
local sound3 = workspace["Clock Ticking"]
local sound4 = workspace["Lethalovania"]
local lighting = game:GetService("Lighting")
local SSS = game:GetService("ServerScriptService")
while true do
sound2:Play()
task.wait(3)
sound:Play()
SSS.BlasterDupeScript.Disabled = true
SSS.BoneSpinsScript.Disabled = true
SSS.BoneDupeScript.Disabled = true
SSS.AxesDupeScript.Disabled = true
SSS.ChungDupeScript.Disabled = true
local plrs = game.Players:GetPlayers()
local colorCorrection = lighting.ColorCorrection
for i = 1,100 do
colorCorrection.Contrast -= 0.02
sound4.PlaybackSpeed -= 0.01
for _, plr in pairs(game.Players:GetPlayers()) do
plr.Character:WaitForChild("Humanoid").WalkSpeed = 0
plr.Character:WaitForChild("HumanoidRootPart").Anchored = true
task.wait(0.01)
game.Players.PlayerAdded:Connect(function(player)
plr.Character:WaitForChild("Humanoid").WalkSpeed = 0
plr.Character:WaitForChild("HumanoidRootPart").Anchored = true
end)
end
task.wait(0.01)
end
sound3:Play()
sound3.Looped = true
for i = 1,200 do
for _, plr in pairs(game.Players:GetPlayers()) do
plr.Character:WaitForChild("Humanoid").WalkSpeed = 0
plr.Character:WaitForChild("HumanoidRootPart").Anchored = true
game.Players.PlayerAdded:Connect(function(player)
plr.Character:WaitForChild("Humanoid").WalkSpeed = 0
plr.Character:WaitForChild("HumanoidRootPart").Anchored = true
end)
task.wait(0.005)
end
end
sound3.Looped = false
SSS.BlasterDupeScript.Enabled = true
SSS.BoneSpinsScript.Enabled = true
SSS.BoneDupeScript.Enabled = true
SSS.AxesDupeScript.Enabled = true
SSS.ChungDupeScript.Enabled = true
for i = 1,100 do
sound4.PlaybackSpeed += 0.01
colorCorrection.Contrast += 0.02
for _, plr in pairs(game.Players:GetPlayers()) do
plr.Character:WaitForChild("Humanoid").WalkSpeed = 50
plr.Character:WaitForChild("HumanoidRootPart").Anchored = false
game.Players.PlayerAdded:Connect(function(player)
plr.Character:WaitForChild("Humanoid").WalkSpeed = 50
plr.Character:WaitForChild("HumanoidRootPart").Anchored = false
end)
task.wait(0.01)
end
end
task.wait(35)
end
For context, this script is a global serverscript that freezes everyone if they are ingame or have joined in the game. Here’s the problem,
plr.Character:WaitForChild("Humanoid").WalkSpeed = 0
plr.Character:WaitForChild("HumanoidRootPart").Anchored = true
or
plr.Character:WaitForChild("Humanoid").WalkSpeed = 50
plr.Character:WaitForChild("HumanoidRootPart").Anchored = false
These two run even if a player hasn’t fully loaded in the game yet and I do not know how to adjust the script so that anybody that joins ingame while the script is active does not break it, because from what I know the script will attempt to find the player character’s Humanoid/HumanoidRootPart, regardless if the player has loaded in or not, which causes the script to break and I do not know how to counteract this.
game.Players.PlayerAdded:Connect(function(player)
plr.Character:WaitForChild("Humanoid").WalkSpeed = 50
plr.Character:WaitForChild("HumanoidRootPart").Anchored = false
end)
or the opposite of it also doesn’t work. I’ve also tried waiting for the player’s character but it just returns to a infinite yield, which also breaks the script, and putting
game.Players.PlayerAdded:Connect(function(player)
plr.Character:WaitForChild("Humanoid").WalkSpeed = 50
plr.Character:WaitForChild("HumanoidRootPart").Anchored = false
end)
before
for _, plr in pairs(game.Players:GetPlayers()) do
...
end
.
Is there any way I can make it so that the script both affects the player’s humanoid properties/ anchor the humanoidrootpart for both the players who are ingame, and those who have joined but haven’t fully loaded yet not break the script? If anyone would like to respond, please do so! I’d appreciate it.