Advertisement
akitheone

Untitled

Nov 14th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.65 KB | None | 0 0
  1. local NpcManager = require(game.ServerScriptService.NPC.NpcManager)
  2. local NpcController = require(game.ServerScriptService.NPC.NpcController)
  3. local Gui = script.Parent.Value
  4.  
  5. local runs = game:GetService("RunService")
  6. local hb = runs.Heartbeat
  7.  
  8.  
  9. hb:Connect(function()
  10.     if(NpcManager.ActiveCombatNpcs[Gui] ~= nil) then
  11.         local npc = NpcManager.ActiveCombatNpcs[Gui].NpcClassData
  12.         NpcController.ProcessHits(npc)
  13.     end
  14. end)
  15.  
  16. while true do
  17.     hb:wait()
  18.     if(NpcManager.ActiveCombatNpcs[Gui] ~= nil) then
  19.         local npc = NpcManager.ActiveCombatNpcs[Gui].NpcClassData
  20.         NpcController.ProcessFollowPaths(npc)
  21.         NpcController.ProcessMovement(npc)
  22.     end
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement