iGotRekt
|
  |
| Joined: 23 Jan 2014 |
| Total Posts: 831 |
|
|
| 29 Jan 2015 01:30 AM |
local door = script.Parent.AutoDoor local doorleft = door.DoorLeft:GetChildren() local doorright = door.DoorRight:GetChildren() local enabled = true
while true do for i, v in pairs(game.Players:GetChildren()) do print('Game located children') if (v.Character.Torso.Position - door.Position).magnitude <= 15 and enabled then enabled = false for i = 0, 5, 0.05 do doorleft.Position = Vector3.new(doorleft.Position.x -5, doorleft.Position.y, doorleft.Position.z) doorright.Position = Vector3.new(doorright.Position.x +5, doorright.Position.y, doorright.Position.z) wait(0.1) end print('Doors have opened') end if (v.Character.Torso.Position - door.Position).magnitude > 15 and enabled then doorleft.Position = Vector3.new(doorleft.Position.x +5, doorleft.Position.y, doorleft.Position.z) doorright.Position = Vector3.new(doorright.Position.x -5, doorright.Position.y, doorright.Position.z) end print('Doors have closed') end print('Operation is a success! Congratulations!') wait(1) enabled = true wait() end
--[[ // Don't mind the prints, they're just checks to see how far the script runs before encountering an error. My door has multiple bricks, so I am trying to select groups of them at the same time and move each group a certain amount of studs at the same time. I'm not very familiar with the 'GetChildren()' command, so that might be the problem here. Thank you for the help, anyway. // --]]
✗ вυяиσυт699 » ɪGᴏᴛRᴇᴋᴛ
✗ вυяиσυт699 » ɪGᴏᴛRᴇᴋᴛ |
|
|
| Report Abuse |
|
|
iGotRekt
|
  |
| Joined: 23 Jan 2014 |
| Total Posts: 831 |
|
|
| 29 Jan 2015 01:31 AM |
I just want to add that whenever I run the script, it skips right down to the last print, where it says "print('Operation is a success! Congratulations!')
✗ вυяиσυт699 » ɪGᴏᴛRᴇᴋᴛ |
|
|
| Report Abuse |
|
|
iGotRekt
|
  |
| Joined: 23 Jan 2014 |
| Total Posts: 831 |
|
| |
|
iGotRekt
|
  |
| Joined: 23 Jan 2014 |
| Total Posts: 831 |
|
| |
|
| |
|
iGotRekt
|
  |
| Joined: 23 Jan 2014 |
| Total Posts: 831 |
|
|
| 29 Jan 2015 09:35 PM |
Operation is a success! Congratulations! --What I told it to print
Game located children --What I told it to print 17:34:37.674 - Position is not a valid member of Model 17:34:37.675 - Script 'Workspace.Script', Line 24 17:34:37.675 - Stack End
✗ вυяиσυт699 » ɪGᴏᴛRᴇᴋᴛ |
|
|
| Report Abuse |
|
|
iGotRekt
|
  |
| Joined: 23 Jan 2014 |
| Total Posts: 831 |
|
|
| 29 Jan 2015 09:43 PM |
I think I found the problem.
doorleft.Position = Vector3.new(doorleft.Position.x +5, doorleft.Position.y, doorleft.Position.z) doorright.Position = Vector3.new(doorright.Position.x -5, doorright.Position.y, doorright.Position.z)
When I call this, I am calling the table's position, not what is in the table. So I should probably try and create another for b, c in pairs loop for the trade specifically!
✗ вυяиσυт699 » ɪGᴏᴛRᴇᴋᴛ |
|
|
| Report Abuse |
|
|