I am trying to make a cool game, and I want to know how to add a block mesh into every body part of a player except for the head when they join/respawn. I also want to know how to add a head mesh into a player's head under these conditions. Any advice?
✓ ANSWER ACCEPTED
How could I make a script that adds a mesh into players when entering?
2 answers
✓ Accepted answer
game.Players.PlayerAdded:connect(function(Player)
Player.CharacterAdded:connect(function(Character)
for i, part in pairs(Character:GetChildren()) do
if part:IsA("Part") then
if part.Name ~= "Head" then
local Mesh = Instance.new("SpecialMesh", part)
Mesh.Name = "Mesh"
Mesh.MeshId = ""
Mesh.TextureId = ""
Mesh.MeshType = "Head" -- Whatever mesh type you want in it.
else
local Mesh = Instance.new("SpecialMesh", part)
Mesh.Name = "Mesh"
Mesh.MeshType = "Head"
end
end
end
end)
end)
You can use the Player Added event and inside of that function use the Character Added to add a mesh to a player everytime he/she spawns.
This discussion is preserved as it was. New answers, comments, and votes are closed.
