And so, since I'm not a lua professional, I don't know how to fix the error. If the player's Y position is greater than the rocket's Y position, then the rocket's Y position is increased by 0.1. And if less than the opposite. And when the script starts working, this error appears "Y cannot be assigned to"
This is my code: (thanks in advance)
while 1==1 do wait() playerY = _G.evastefan.Torso.Position.Y if rocket.Position.Y < playerY then rocket.Position.Y = rocket.Position.Y+0.1 else rocket.Position.Y = rocket.Position.Y-0.1 end end
You can't assign properties in a Vector3.
To change these values, you'll need to set the Position to a new Vector3, after setting it to move where you want it to.
while 1==1 do wait() playerY = _G.evastefan.Torso.Position.Y if rocket.Position.Y < playerY then rocket.Position = rocket.Position + Vector3.new(0, 0.1, 0) --Add the new vector Vector3.new(0, 0.1, 0) to our rocket so we move it up else rocket.Position = rocket.Position - Vector3.new(0, 0.1, 0) --And vise versa for moving it down end end