I am making something where if you press Q, anyone within 200 studs will stop moving completely, but this won't work in-game, only in Studio.
Here's the code I used:
game.Players.PlayerAdded:Connect(function(player)
wait(.1)
hi = player.Name
print(hi)
local player = game.Players[hi]
player:GetMouse().KeyDown:Connect(function(k)
if k == "q" and player.Name == "bearpro2" then
for i, v in pairs(workspace:GetChildren()) do
if v:FindFirstChild("Humanoid") then
if v.Name == player.Name then
else
if (v.Torso.Position - player.Character.Torso.Position).Magnitude <= 200 then
v.Torso.Anchored = true
v["Right Leg"].Anchored = true
v["Right Arm"].Anchored = true
v["Left Leg"].Anchored = true
v["Left Arm"].Anchored = true
end
end
end
end
end
end)
end)

2 comments
Maybe you didn't upload these?
I thought that at first too, but then I published the game and it still didn't work.