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

How do I make this arm back to it's position?

Asked by 8 years ago
local bool = false
grave = script.Parent.Parent
zombiehand = script.Parent
Touch = grave.touch
position = grave.p2.Position
zombiehandcframe = zombiehand.Position

function handpopup(hit) 
    if hit.Parent and hit.Parent.Humanoid then
        if hit.Parent.Parent ~= nil then
            if bool == false then       
                bool = true
                local cframe=zombiehand.CFrame
                for t = 0, 1.5, 1/(cframe.p-position).magnitude do
                    wait(0.1)
                    zombiehand.CFrame = cframe-cframe.p+cframe.p:lerp(position,t)
                    bool = false
                end
            end
        end
    end
end

--[[function handback(hit)
    if hit == nil then
        if bool == false then 
            bool = true do
                local cframe=zombiehand.CFrame
                for t = 1, 1, 0/(cframe.p-position).magnitude do
                    wait(0.1)
                    zombiehand.CFrame = cframe-cframe.p+cframe.p:lerp(position,t)
                    bool = false
                end
            end
        end
    end
end--]]

--script.Parent.TouchEnded:connect(handback)
Touch.Touched:connect(handpopup)
0
I want the player to step on the grave then the arm pop out and then if they aren't touching it no more then it goes back to it's position BuilderCosmic 43 — 8y

Answer this question