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: Broken elevator script (easy)

Previous Thread :: Next Thread 
BobGeorgenworn909 is not online. BobGeorgenworn909
Joined: 03 Apr 2008
Total Posts: 1161
28 Aug 2011 07:05 AM
debounce = 0

script.Parent.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and debounce == 0 then
debounce = 1
script.Parent.BodyPosition.position = Vector3.new(75,95.4,-68)
end
while wait() do
if script.Parent.Position == Vector3.new(75,95.4,-68) then
script.Parent.BodyPosition.position = Vector3.new(75,71.8,-68)
end
if script.Parent.Position == Vector3.new(75,71.8,-68) then
debounce = 0
end
end
end)

It's un-anchored. It contains BodyPosition and BodyGyro.
The brick just stays on the ground.
Report Abuse
BobGeorgenworn909 is not online. BobGeorgenworn909
Joined: 03 Apr 2008
Total Posts: 1161
28 Aug 2011 07:13 AM
I just realized I put an end in the wrong spot, but it's still broken.

New script:
debounce = 0

script.Parent.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and debounce == 0 then
debounce = 1
script.Parent.BodyPosition.position = Vector3.new(75,95.4,-68)
wait(1)
while wait() do
if script.Parent.Position == Vector3.new(75,95.4,-68) then
script.Parent.BodyPosition.position = Vector3.new(75,71.8,-68)
end
if script.Parent.Position == Vector3.new(75,71.8,-68) then
debounce = 0
end
end
end
end)
Report Abuse
TheCapacitor is not online. TheCapacitor
Joined: 19 Jan 2011
Total Posts: 7045
28 Aug 2011 07:15 AM
Hows it not work? Does it not move, or does it not stop? or?
Report Abuse
BobGeorgenworn909 is not online. BobGeorgenworn909
Joined: 03 Apr 2008
Total Posts: 1161
28 Aug 2011 07:16 AM
It doesn't start moving. The brick is un-anchored, is it supposed to be?
Report Abuse
TheCapacitor is not online. TheCapacitor
Joined: 19 Jan 2011
Total Posts: 7045
28 Aug 2011 07:17 AM
Huh, did you give the BodyPosition enough force?
Report Abuse
BobGeorgenworn909 is not online. BobGeorgenworn909
Joined: 03 Apr 2008
Total Posts: 1161
28 Aug 2011 07:18 AM
I didn't edit the force, how much force does it need to lift someone?
Report Abuse
TheCapacitor is not online. TheCapacitor
Joined: 19 Jan 2011
Total Posts: 7045
28 Aug 2011 07:20 AM
Well, I would use this:

BodyPosition.force = Part:GetMass * 3.

I don't really know a useful mass, it's been a while since I ever had to use a B*.
Report Abuse
BobGeorgenworn909 is not online. BobGeorgenworn909
Joined: 03 Apr 2008
Total Posts: 1161
28 Aug 2011 07:20 AM
Also, I've never worked with BodyPosition before, do I edit D, P, or MaxForce?
Report Abuse
BobGeorgenworn909 is not online. BobGeorgenworn909
Joined: 03 Apr 2008
Total Posts: 1161
28 Aug 2011 07:21 AM
Oops, you posted that before me
Report Abuse
TheCapacitor is not online. TheCapacitor
Joined: 19 Jan 2011
Total Posts: 7045
28 Aug 2011 07:21 AM
D = Dampening
P = Power
MaxForce = ...MaxForce

The higher D is, the less the BP will "spike" when it moves.
The higher P is, the more the BP with spike.
MaxForce = How much force the BP can use.
Report Abuse
NXTBoy is not online. NXTBoy
Joined: 25 Aug 2008
Total Posts: 4533
28 Aug 2011 07:24 AM
Here you go:

local elevator = script.Parent

local moving = false
local top = Vector3.new(75,95.4,-68)
local bottom = Vector3.new(75,71.8,-68)

script.Parent.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and not moving then
moving = true

elevator.BodyPosition.position = top
while (elevator.Position - top).magnitude > 1 do wait() end
wait(1)

elevator.BodyPosition.position = bottom
while (elevator.Position - bottom).magnitude > 1 do wait() end
wait(1)

moving = false
end
end)
Report Abuse
BobGeorgenworn909 is not online. BobGeorgenworn909
Joined: 03 Apr 2008
Total Posts: 1161
28 Aug 2011 07:26 AM
@Capacitor error: Workspace.Part.Script:5: function arguments expected near '*'

@NXT I'll try that
Report Abuse
BobGeorgenworn909 is not online. BobGeorgenworn909
Joined: 03 Apr 2008
Total Posts: 1161
28 Aug 2011 07:31 AM
@NXT yours doesn't work either :/
Report Abuse
Rames7 is not online. Rames7
Joined: 19 Nov 2009
Total Posts: 547
28 Aug 2011 08:03 AM
Look here:

http://wiki.roblox.com/index.php/How_To_Make_an_Elevator
Report Abuse
NXTBoy is not online. NXTBoy
Joined: 25 Aug 2008
Total Posts: 4533
28 Aug 2011 09:03 AM
> @NXT yours doesn't work either :/

Bet you your part is connected to another anchored part. Try changing the `BodyPosition` by hand.
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