How do I make this arm back to it's position?
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)