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

How do i make an elevator? (still confused)

Asked by 9 years ago

Im not asking you to make it for me. im asking you for help. i did the following code for example

example : car1 example 2 : vector 3 : 0,2,0

`s = script g = game.Workspace

Car = s.Parent.Parent.Car1

function onClicked() Car.BodyVelocity.velocity = Vector3.new(0, -3, 0) end script.Parent.ClickDetector.MouseClick:connect(onClicked)

there's one thing i put for down. but the problem is. do i use weld for this. to prevent it from breaking apart? or. atleast give me a site to were i can find out how to do it effeciently. help me here! please. `

2 answers

Log in to vote
1
Answered by
iaz3 190
9 years ago

Use bodyPosition to move it to a position, generally you have invisible markers at the floor, and you can put their position in a bodyPosition , which will cause it to move to the floor.

If using multiple parts, you should either use a weld script to weld it all together, or the weld surface type when building.

s = script
g = game.Workspace

Car = s.Parent.Parent

function onClicked()
    Car.BodyPosition.position = Car.Position + Vector3.new(0,3,0)
end

script.Parent.Parent.CD.MouseClick:connect(onClicked)

The above code will work, assuming you have the required BodyPosition.

It will move the Car up 3 from its original position.

Also, increase the maxforce of the BodyPosition, i used 40000

You will probably want a BodyGyro in there to keep Car stable, make sure to include the maxforce of Y in it.

You can from here add buttons to control the elevator up or down, or add floors. If you have for example an invisible marker at Floor one you can change

Car.BodyPosition.position = Car.Position + Vector3.new(0,3,0)

to

Car.BodyPosition.position = FloorOneMarker.Position
0
Ok. so i can copy this exact thing but change vector3? legoson7 70 — 9y
0
Yes, it should work exactly. Assuming you have everything in the correct place. You might want to modify the paths to the ClickDetector or the car depending on your setup. iaz3 190 — 9y
0
Im currently on studio now. i dont understand how its not working. heres what i did. i welded everything to be in place. took the thing i wanted to be a button. added clickdetector and a script in it. put YOUR script in it. then i added body force and position to Car. and i upgraded the force. im still confused legoson7 70 — 9y
0
also im getting a argument saying CD isnt part of model legoson7 70 — 9y
View all comments (6 more)
0
WAIT!!!!!!!! do i put clickdetector and that script in the car???? legoson7 70 — 9y
0
Before trying to script, Please learn basic scripting and logic. iaz3 190 — 9y
0
Read the script, and change it AS I TOLD YOU TO DO, so it will lead to where you put everything. Unless your click detector is named CD, CD will obviously not be found. I never said to use bodyforce, i said bodyGYRO. iaz3 190 — 9y
0
"before trying to script, Please learn basic scripting and logic." uhh. thats sorta offensive. you should really look at the games i made :/ legoson7 70 — 9y
0
I am sorry, it was not my intention to be offensive. iaz3 190 — 9y
0
forgiven legoson7 70 — 9y
Ad
Log in to vote
0
Answered by 9 years ago

Why do you need a car if you are making an elevetor?

If you want to make an elevator I recommend using a for loop and CFrame.

0
car1 represents the baseplate of the elevator. legoson7 70 — 9y
0
So use CFrame inside a for loop. xXPowerBladeXx 5 — 9y

Answer this question