OnlineOne
|
  |
| Joined: 14 Jul 2011 |
| Total Posts: 1193 |
|
|
| 01 Jul 2016 12:21 PM |
local parent = script.Parent local workspace = game.Workspace local parts = {workspace.Button1, workspace.Button2, workspace.Button3, workspace.Elevator}
function onClicked(click) local currentHeight = workspace.Elevator.Position.Y local desiredHeight = 0--enter height you want to move to local waitTime = 0.03--enter speed between each increment (0.03 minimum) local moveIncrement = 0.1--enter studs moved per waitTime local part = 1 parts[4]:WaitForChild("isMoving").Value = true while desiredHeight ~= currentHeight and wait(waitTime) do if desiredHeight < currentHeight then repeat parts[part].Position = parts[part].Position + Vector3.new(0, moveIncrement, 0) if part < #parts + 1 then part = part + 1 elseif part >= #parts + 1 then part = 1 end until part >= #parts elseif desiredHeight > currentHeight then repeat parts[part].Position = parts[part].Position - Vector3.new(0, moveIncrement, 0) if part < #parts + 1 then part = part + 1 elseif part >= #parts + 1 then part = 1 end until part >= #parts end end parts[4]:WaitForChild("isMoving").Value = false end
parent.ClickDetector.MouseClick:connect(onClicked)
I tried this. The first three parts move further than the fourth one. Also, their position is about twenty, but instead of moving down, they're moving up. Please help. |
|
|
| Report Abuse |
|
|
Kurokku
|
  |
| Joined: 01 Aug 2015 |
| Total Posts: 3622 |
|
|
| 01 Jul 2016 12:23 PM |
| Why did you create another forum, post on the other one |
|
|
| Report Abuse |
|
|
OnlineOne
|
  |
| Joined: 14 Jul 2011 |
| Total Posts: 1193 |
|
|
| 01 Jul 2016 12:28 PM |
| Because I bumped four times over like a day, and nobody responded. That forum is long gone. |
|
|
| Report Abuse |
|
|
OnlineOne
|
  |
| Joined: 14 Jul 2011 |
| Total Posts: 1193 |
|
|
| 01 Jul 2016 01:30 PM |
| See? This is what happens. Bump. |
|
|
| Report Abuse |
|
|
OnlineOne
|
  |
| Joined: 14 Jul 2011 |
| Total Posts: 1193 |
|
| |
|
OnlineOne
|
  |
| Joined: 14 Jul 2011 |
| Total Posts: 1193 |
|
|
| 01 Jul 2016 07:23 PM |
| Bump. If I don't get an answer soon, I'm reposting.. again. |
|
|
| Report Abuse |
|
|
Kurokku
|
  |
| Joined: 01 Aug 2015 |
| Total Posts: 3622 |
|
|
| 01 Jul 2016 08:17 PM |
| Maybe posting the errors that were given in the output box would help... You can't expect someone to find a small error in a long script |
|
|
| Report Abuse |
|
|
OnlineOne
|
  |
| Joined: 14 Jul 2011 |
| Total Posts: 1193 |
|
| |
|
OnlineOne
|
  |
| Joined: 14 Jul 2011 |
| Total Posts: 1193 |
|
| |
|