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)

1 comment

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