Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

When I clone someone, how do I turn them into Granite including their hats?

Asked by 10 years ago

I tried to Make this clone's head into granite, but it wouldn't have granite head.

1 answer

Log in to vote
1
Answered by 10 years ago

Use a For loop, :GetChildren(), and :IsA() and do something like the following:

for i, v in pairs(game.Workspace.ClonedPersonBody:GetChildren()) do --go through the loop for however many children the player's character has
    if v:IsA("Part") or v:IsA("Hat") then --check to see if each child is a hat or a part
        v.Material = "Granite" --change material to granite
    end
    wait(0) --leave this here or your game could crash
end

I'm not guaranteeing that this script will work, I just provided a rough outline that you should follow.

Ad

Answer this question