generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Elevator is not working. Please help.

Previous Thread :: Next Thread 
cj0707 is not online. cj0707
Joined: 06 Oct 2009
Total Posts: 196
07 Jun 2012 12:04 PM
I am making a elevator using BodyVelocity (and scripts oh yeah and a NumberValue :]) but the buttons just set the NumberValue which is named 'floor' and that works great but I also have a main script running the whole elevator and this is the script:


local level = script.Parent.floor
local car = script.Parent.Car1

function check()
while true do
wait(1)
if level.Value == 1 then
script.Parent.floora.CanCollide = false
script.Parent.floorab.CanCollide = false
car.BodyVelocity.velocity = Vector3.new(0, -10, 0)
elseif level.Value == 2 then
script.Parent.floora.CanCollide = true
script.Parent.floorab.CanCollide = true
car.BodyVelocity.velocity = Vector3.new(0, 10, 0)
elseif level.Value == 3 then
script.Parent.floora.CanCollide = false
script.Parent.floorab.CanCollide = false
car.BodyVelocity.velocity = Vector3.new(0, 10, 0)
wait(1)
end
end
end


I know that I have no way of getting from floor three to floor two without going to floor one first but that is something that I will fix later on this is just a rough draft. I really don't know whats wrong with it and there is no output. Please help.
Report Abuse
cj0707 is not online. cj0707
Joined: 06 Oct 2009
Total Posts: 196
07 Jun 2012 12:11 PM
The bump has arrived where do you want it?
Report Abuse
cj0707 is not online. cj0707
Joined: 06 Oct 2009
Total Posts: 196
07 Jun 2012 12:15 PM
hmm please help!
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
07 Jun 2012 12:17 PM
The bump has arrived too early, I say. (>")>

Is the maxForce property set to something ridiculous like (math.huge, math.huge, math.huge)?

If not, set it so, because it may not have enough force to push up the lift.
Report Abuse
cj0707 is not online. cj0707
Joined: 06 Oct 2009
Total Posts: 196
07 Jun 2012 12:21 PM
oh yes it is very high :D
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
07 Jun 2012 12:24 PM
Hehe good :D

If it's still not working, try changing the .velocity.

IMO, like i said in the other post, I reckon you should use a bodyPosition, because all you have to do is set the .p to the desired vector, and it does all the work for you.
Report Abuse
cj0707 is not online. cj0707
Joined: 06 Oct 2009
Total Posts: 196
07 Jun 2012 12:31 PM
wait your confusing me now I tried that do I define where to find BodyPosition define where button1 is? where do I put BodyPosition
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
07 Jun 2012 12:31 PM
But the bodyPosition in the part you want to move, silly.
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
07 Jun 2012 12:33 PM
Put*

Gah. =]
Report Abuse
cj0707 is not online. cj0707
Joined: 06 Oct 2009
Total Posts: 196
07 Jun 2012 12:34 PM
I want all of it to move including the character
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
07 Jun 2012 12:37 PM
I was in a lift at college today, and the lift didn't leave me behind, lol.

Yes, it SHOULD take the player with it as it ascends, just don't make it too fast that it doesn't actually collide with the player (granted that is a high speed indeed)
Report Abuse
cj0707 is not online. cj0707
Joined: 06 Oct 2009
Total Posts: 196
07 Jun 2012 12:50 PM
I don't understand can you give it to me in steps?
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
07 Jun 2012 12:59 PM
Make your elevator model, or it could just me a single part.

Insert a bodyPosition and set the maxForce really high, and set the dampening quite high too, as you want the elevator to slow down as it approaches it's destination.

Build your building or whatever

Note down the Y value of the postion of each floor

Attach buttons to your elevator model

Put the Y values in a table (you don't have to, but it makes it easier to read)

Script functions for the buttons being clicked to change the bodyPostion.pm, which is the vector it attempts to reach for you, to one of that in the table.

Tweak, probably, as it won't be perfect first time.

Hey presto, there's your elevator.
Report Abuse
cj0707 is not online. cj0707
Joined: 06 Oct 2009
Total Posts: 196
08 Jun 2012 08:44 AM
thanks but whats bodyPosition.pm?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image