Hello, so this script should have worked properly but im having problem with names. So i made a quick thing to show as an example.. The names arent working properly. So what it's supposed to do is cframe every part besides character bodyparts to HumanoidRootPart cframe but the issue is that it cframes the bodyparts too.

How can i fix this:

local CharacterBodyParts = {}

for i,v in next, game:GetService("Players"):GetPlayers() do
    for _,x in next, v.Character:GetChildren() do
        if x:IsA("BasePart") or x:IsA("MeshPart") then
            table.insert(CharacterBodyParts, x.Name)
        end
    end
end

for i,v in next, workspace:GetDescendants() do
    for _,x in next, CharacterBodyParts do
        if v:IsA("BasePart") and tostring(v.Name) ~= x then
            v.CFrame = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame
        end
    end
end

Any help is appreciated.

3 comments

0

Are you trying to teleport the player's character?

0

No im trying to teleport every part in workspace except player's bodyparts

0

Can someone answer please?