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 move = Vector3.new(1,1,1) for t = 0, position, move do wait(0.1) zombiehand = t end end end end end Touch.Touched:connect(handpopup)
So I have a grave built and I when the player touch the grave the zombie hand pop out but I can't seem to make the hand pop out using loop.
for loops don't take Vector3s as parameters, they use numbers. zombiehand is also initially defined as script.Parent
and on line 16 you're changing it to a number, which is strange. Instead of trying to use objects in a for loop, interpolate the position:
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, 1/(cframe.p-position).magnitude do wait(0.1) zombiehand.CFrame = cframe-cframe.p+cframe.p:lerp(position,t) end end end end end Touch.Touched:connect(handpopup)