Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make it happen to everyone at the same time rather than loop?

Asked by 5 years ago

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!

0
do: for I, in PEEPSTABLE do players.Character.Humanoid.Walkspeed = 0 aandmprogameing 52 — 5y
0
I don't want to make their walkspeed 0 though... The whole point is freezing every limb. So if they jump, they freeze in mid-air xXTouchOfFrostXx 125 — 5y

Answer this question