I'm trying to create a script which freezes everyone apart from the person who caused it. This is followed on by a color correction into Black and White.
However, the script starts with one player, freezes them, after the colour is normal, unfreezes and then freezes the next.. etc
But I want all players to freeze at the same time rather than loop through them. Any ideas?
My code:
game.ReplicatedStorage.Freeze.OnServerEvent:Connect(function(player) local TweenService = game:GetService("TweenService") local part = game.Lighting.ColorCorrection local Info = TweenInfo.new( 10, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, true, 0) local Goals ={ Saturation = -1} local tween = TweenService:Create(part,Info,Goals) tween:Play() for _, child in ipairs(game.Players:GetChildren()) do if child.Name ~= player.Name then local Them = child.Character wait() for _, NotThem in ipairs(Them:GetChildren()) do wait() if NotThem.ClassName == "Part" or NotThem.ClassName == "MeshPart" then NotThem.Anchored = true end end wait(20) for _, NotThem in ipairs(Them:GetChildren()) do wait() if NotThem.ClassName == "Part" or NotThem.ClassName == "MeshPart" then NotThem.Anchored = false end end end end end)
Thank you!