Trouble with Editing AssemblyLinearVelocity

Hello. I am trying to make a ski lift for my ROBLOX game. I have a script that starts the chairlift up. It increases the AssemblyLinearVelocity so that the lift can start moving. The chair itself connects to a part that slides across the part with a -5 value of Z for the AssemblyLinearVelocity. The problem is that when I press the button, there is a huge delay for the chair to start moving. Then, when I check, it never changes. Please let me know if you find any errors in the script.

1 Like

1 Like

Let’s rewrite this script so it’s more readable first:

local grizzlysegment = workspace:WaitForChild("grizzlysegment1")

script.Parent.MouseClick:Connect(function()
	local starttime = os.clock()
	
	repeat
		-- grizzly code here (too lazy to type it)
	until os.clock() - starttime > 5 -- this will repeat the function for 5 seconds
end)

Also, remember that wait() is deprecated, and task.wait() is now the new and improved function!

I’m not too sure what’s causing that problem of yours unless you’ve got some client-server magic tricks going on that I can’t see or the machine you’re testing it on is really laggy.

Let me know if you run into anymore troubles!

1 Like

Thank you so much for the reply I will give it a try. I will let you know if it works or not.

1 Like

I tried it, and it still doesn’t work. My computer isn’t laggy either. I don’t understand why this is happening and it’s very frustrating.

1 Like

Is this the only script? Just checking there isn’t any server magic going on behind the scenes.

So sorry for the late response. There is one other script, but that doesn’t have to do with anything with that part of the lift. The script above was a server script, and there are no local scripts for it.

1 Like