|
| 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 |
|
|
|
| 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 |
|
|
|
| 28 Aug 2011 07:15 AM |
| Hows it not work? Does it not move, or does it not stop? or? |
|
|
| Report Abuse |
|
|
|
| 28 Aug 2011 07:16 AM |
| It doesn't start moving. The brick is un-anchored, is it supposed to be? |
|
|
| Report Abuse |
|
|
|
| 28 Aug 2011 07:17 AM |
| Huh, did you give the BodyPosition enough force? |
|
|
| Report Abuse |
|
|
|
| 28 Aug 2011 07:18 AM |
| I didn't edit the force, how much force does it need to lift someone? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 28 Aug 2011 07:20 AM |
| Also, I've never worked with BodyPosition before, do I edit D, P, or MaxForce? |
|
|
| Report Abuse |
|
|
|
| 28 Aug 2011 07:21 AM |
| Oops, you posted that before me |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 28 Aug 2011 07:26 AM |
@Capacitor error: Workspace.Part.Script:5: function arguments expected near '*'
@NXT I'll try that |
|
|
| Report Abuse |
|
|
|
| 28 Aug 2011 07:31 AM |
| @NXT yours doesn't work either :/ |
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|