Hi there, can Anyone help me? I want that in my Game all Players are a normal „Part“ How Can I let the Player be a Part and not a human Charakter?
1 Like
I might be mistaken, but do you want to make the player invisible and put a part in the place of their character?
If so, before reading the code, try to do these steps yourself.
- Get the player
- Get the character
- Loop through the character’s parts and make them invisible
- Make a new part
- Update the part’s position every frame
- Done!
local player = game.Players.LocalPlayer
local character = player.Character or player.Character:Wait()
for _, part in pairs(character:GetDescendants()) do -- Loop through the character's descendants
if part:IsA("BasePart") or part:IsA("MeshPart") then
part.Transparency = 1
part.CanCollide = false
end
end
local replacementpart = Instance.new("Part")
replacementpart.Parent = workspace
replacementpart.Size = Vector3.new(10,6,10) -- Feel free to adjust this as you want
replacementpart.Anchored = true
replacementpart.CanCollide = false
-- Change the CFrame of the part to the CFrame of the Humanoid Root Part
game:GetService("RunService").Heartbeat:Connect(function()
local hrpPos = character:WaitForChild("HumanoidRootPart").CFrame
replacementpart.CFrame = hrpPos
end)
Feel free to ask me any questions!
2 Likes
But where do I need to make a Script in the Part or in starterplayer?
You can put the script anywhere into the client. StarterGUI, StarterPack, etc.
1 Like