Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function dockSearch {
- parameter originPart.
- set result to originPart.
- local partStack is list().
- partStack:add(originPart).
- local i is 0.
- until i = partStack:length{
- if partStack[i]:children:empty = false
- for child in partStack[i]:children
- if child isn't a docking port // probably some way of checking using part modules
- partStack:add(child).
- else{
- set result to child.
- break.
- }
- set i to i + 1.
- }
- return result.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement