Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I change anchored part velocity remotely?

Asked by 5 years ago

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

0
wow this script you're showing is an absolute disaster DeceptiveCaster 3761 — 5y
0
Yeah.. i recreated it as a rough copy because i didnt have access to my files on the computer i was working from. RingedAsh43 0 — 5y

1 answer

Log in to vote
0
Answered by
Amiaa16 3227 Moderation Voter Community Moderator
5 years ago

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

Ad

Answer this question