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

Would I be able to make this move?

Asked by 8 years ago

I have a script that morphs the player into a model. How would I make the player move? It seems to be anchored to one spot and I can't even move the camera.

local MorphName = "Derac" 
local MorphDirectory = game.ServerStorage 



script.Parent.MorphButton.MouseButton1Down:connect(function()
    local Character = game.Players.LocalPlayer.Character
    if Character then
        local TorsoPos = Character.Torso.CFrame.p
        Character:ClearAllChildren()
        local MorphClone = MorphDirectory[MorphName]:Clone()
        for _,v in next,MorphClone:GetChildren() do
            v.Parent = Character
        end
        Character:MoveTo(TorsoPos)
        for x = 1,3 do
            Character:MakeJoints()
        end
        for _,v in next,Character:GetChildren() do
            if v.Anchored == true then
                if v:IsA("BasePart") then
                    v.Anchored = false
                end
            end
        end
        wait()
        MorphClone:remove()
    end
end)

1 answer

Log in to vote
2
Answered by 8 years ago
script.Parent.MorphButton.MouseButton1Down:connect(function()
local Character = game.Players.LocalPlayer.Character
    if Character then
        local TorsoPos = Character.Torso.CFrame.p
        Character:ClearAllChildren()
        local MorphClone = MorphDirectory[MorphName]:Clone()
            for _,v in next,MorphClone:GetChildren() do
                v.Parent = Character
            end
                Character:MoveTo(TorsoPos)
            for x = 1,3 do
                Character:MakeJoints()
            end
            for _,v in next,Character:GetChildren() do
                if v.Anchored == true then
                    if v:IsA("BasePart") then
                        v.Anchored = false
                    end
                end
            end
        wait()
        MorphClone:remove()
    end
end)

Please use the Code Block next time for your script, it is very hard to read. This is for people if they want to read it easier.

0
Thank you very much. Sorry about that! Andromelus 0 — 8y
Ad

Answer this question