Advertisement
V3N0M_Z

SimplePath API

Feb 2nd, 2021 (edited)
2,001
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.18 KB | None | 0 0
  1. Created by: V3N0M_Z (V3N0M#8545)
  2. Version: 0.25
  3.  
  4. API:
  5.  
  6.     Constructor:
  7.  
  8.         Path SimplePath.new(Model Rig, [Optional] table PathParams, [Optional] bool StorePath)
  9.             -- Creates new Path with optional PathParams
  10.             -- Use one Path per rig
  11.             -- If StorePath is true, the Path object specific to the rig will be save
  12.             -- If you run SimplePath.new(Rig), an existing Path object will return if it was saved
  13.  
  14.     Functions:
  15.  
  16.         bool Path:Run(Vector3 FinalPosition, [Optional] bool VisualizePath)
  17.             -- Starts pathfinding and moves the Rig to FinalPosition
  18.             -- Enable VisualizePath to visualize path // Default: false
  19.             -- Returns true if path is successful
  20.  
  21.         void Path:Stop([Optional] string Status)
  22.             -- Stops moving the Rig and fire Path.Completed sending Status
  23.  
  24.         number Path:Distance(Vector3 TargetPosition or BasePart TargetPart)
  25.             -- Returns the vector magnitude between the Rig and Target
  26.  
  27.         void Path:Destroy()
  28.             -- Destroy Path
  29.  
  30.     Events:
  31.  
  32.         RBXScriptSignal Path.Completed(string Status, Model Rig, Vector3 FinalPosition)
  33.             -- Fires when pathfinding has ended
  34.             -- Check status to see why pathfinding ended
  35.  
  36.         RBXScriptSignal Path.WaypointReached(bool Reached, int CurrentWaypoint, table Waypoints)
  37.             -- Fires when a waypoint has been reached
  38.  
  39.         RBXScriptSignal Path.Blocked(int BlockedWaypoint, int CurrentWaypoint, table Waypoints)
  40.             -- Fires when a waypoint has been blocked
  41.  
  42.     Properties:
  43.  
  44.         Model Path.Rig [readonly]
  45.             -- Returns active Rig
  46.  
  47.         Humanoid Path.Humanoid [readonly]
  48.             -- Returns Rig.Humanoid
  49.  
  50.         BasePart Path.HumanoidRootPart [readonly]
  51.             -- Returns Rig.PrimaryPart
  52.  
  53.         Instance Path.Path [readonly]
  54.             -- Returns Path object
  55.  
  56.         Vector3 Path.InitialPosition [writeonly]
  57.             -- Change InitialPosition of the path // Default: Rig.PrimaryPart.Position
  58.  
  59.         int Path.Timeout [writeonly]
  60.             -- Change Rig.HumanoidMoveTo timeout // Default: Automatically Calculated
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement