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

change body parts when touched the block?

Asked by 5 years ago
Edited 5 years ago

Hi. I need to fix my script? I want to change body parts for player when player touched the block for R15 rig type.

function ChangeMe(hit)
    if hit.Parent == nil then return end
    if (hit.Parent:findFirstChild("HumanoidRootPart") == nil) then return end
    local human = hit.Parent:findFirstChild("HumanoidRootPart") 
    local char = hit.Parent
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
    if (human ~= nil) and debounce == false then
        debounce = true
        originals = char:getChildren()
        for w = 1, #originals do
            if originals[w].className == "CharacterMesh" then
                originals[w]:remove()
            end
        end
        meshes = script:getChildren()
        for y = 1, #meshes do
            copy = meshes[y]:clone()
            copy.Parent = char
        end
    end
    debounce = false
end

script.Parent.Touched:connect(ChangeMe)
0
Humanoid Root Par, you forgot to add the -t Pojoto 329 — 5y
1
Thanks for quick reply. the same doesn't work :( Cristials 29 — 5y

Answer this question