Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can I change anchored part velocity remotely?

I want to use a "control button" model to change a conveyors velocity but I can't understand completely how to do it...

belt = game.workspace.bunnyhill
	--location of the conveyor
function onclick()
	if mode = "on" then
		belt.vector3 = 0,0,20
-- attempt to toggle "belt" z velocity to 20
	elseif mode = "off" then 
		belt.vector3 = 0,0,0
--attempt to toggle "belt" z velocity to 0

^Code attempt to toggle conveyor on/off It keeps erroring out saying that it cannot find this property in the part

Not sure how to use vector3 exactly... I've looked at a bunch of websites and none of them explained it clear enough so I decided to come here for answers. If you could help me understand this better I'd appreciate it a lot! --Thanks, RingedAsh43

2 comments

0

wow this script you're showing is an absolute disaster

0

Yeah.. i recreated it as a rough copy because i didnt have access to my files on the computer i was working from.

1 answer

Vector3 is a roblox's data type, which, like any other one can be created by using the new() function of it, like this: Vector3.new(1,0,0)

So, in order to set the velocity of something, you would do this:

belt.Velocity = Vector3.new(0,0,20)

Read more about Vector3 here

This discussion is preserved as it was. New answers, comments, and votes are closed.