This should be something very basic, but even with the condition I passed in my if statement, my character still gets frozen. My stand doesnt freeze though with the condition I pass. How can I freeze other players and not myself.
local partsInWorkspace = workspace:GetDescendants()
for i = 1, #partsInWorkspace do
local thatPart = partsInWorkspace[i]
if thatPart:IsA('BasePart') then
if thatPart.Anchored == false and thatPart.Parent.Name ~= "Star Platinum" and thatPart.Parent.Parent.Name ~= Player.Name then
thatPart.Anchored = true
table.insert(plrTbl, thatPart)
end
end
end
task.wait(5)
for i = 1, #plrTbl do
plrTbl[i].Anchored = false
end
table.clear(plrTbl)
You can do it by looping through all the players and freezing them but yourself like so
for i, oPlayer in pairs(game:GetService("Players"):GetChildren()) do
if oPlayer.Name ~= player.Name and oPlayer.Character then
for _, v in pairs(oPlayer.Character:GetDescendants()) do
if v:IsA("BasePart") or v:IsA("MeshPart") or v:IsA("UnionOperation") then
v.Anchored = true
end
end
end
end
I believe setting the humanoid’s (well, this is assuming that you’re using the roblox characters) walk speed to 0 would be a better practice in this case.
EDIT: Jump power as well, if you need the players to not move at all