Upgrade My Moving Part Script?[CLOSED]

Hello fellow developers, I need help with a moving script that I have.

I want it to be smoother and carry players on the part when you stand on it and it moves.

The game file:
DoubleJump.rbxl (21.8 KB)

The script:

function move(x,y,z)
	for i=1,20 do
		script.Parent.Position = script.Parent.Position + Vector3.new(x,y,z)
		wait(0.01)
	end
end

while true do
	move(-1,0,0)
	move(1,0,0)
end

Seems okay.

I suggest using TweenService for an smooth tween located here:

Click Here!

You can find various tutorials about that. You can do that as example like this:

local TweenInfo = TweenInfo.new() -- Using Default
local TweenService = game:GetService('TweenService')

TweenService:Create(Part,TweenInfo,{CFrame = CFrame.new(Pos)}):Play()

You could implent it as an function as example.

I just wrote this fast so there could be typos But you would see that when it gets tagged as’wrong’

3 Likes