I can't make a functional conveyor

Hello there,
I’m making my game and I’m trying to make conveyor,
But it do not work,
My script

while true do
	if script.Parent.Direction.Value == "Left" then
		script.Parent.Velocity = script.Parent.CFrame.LookVector * 25
	elseif script.Parent.Direction.Value == "Right" then
		script.Parent.Velocity = -script.Parent.CFrame.LookVector * 25
	end
	wait(0.1)
end

Screenshot_3

Thanks for any help

That’s to flip the vector when going in the opposite direction.

@EsplishData have you tried without the frame and the other parts? It might be that your character isn’t properly touching the surface.

Are there any errors on the server when you run your script?

1 Like

Can you elaborate some more? I don’t understand what’s not working. Is the script bugging out of is it just not moving the player once stood on? You may want to try troubleshooting by putting "print(“This line of code ran!”) in certain parts of the script and test if it is printing. Have you set the value of the direction value to “Right” or “Left” yet? Maybe you could try multiplying the look vector by -25 instead of making the
look vector the negative value. Another idea you could try is doing -(script.Parent.CFrame.LookVector * 25). I’m unsure what the issue is so I can’t give that much feedback but I hope this helps!

this tutorial might solve your problem