Hasli4

RBLX. ArmyOpp

Jan 8th, 2026
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.32 KB | None | 0 0
  1. working = true
  2.  
  3. local distance = 0
  4.  
  5. while working do
  6.  
  7.         for _, player in pairs(game.Players:GetPlayers()) do
  8.  
  9.                 distance = player:DistanceFromCharacter(script.Parent.Position)
  10.  
  11.                 if (distance > 0) and (distance < 50) then
  12.  
  13.                         working = false
  14.  
  15.                         script.Parent.Parent.SpawnPoint.Smoke.Enabled = true
  16.  
  17.                         script.Parent.Parent.SpawnPoint.Smoke.Size = 10
  18.  
  19.                         script.Parent.Parent.SpawnPoint.Smoke.RiseVelocity = 10
  20.  
  21.                         script.Parent.Parent.SpawnPoint.Smoke.Opacity = 1
  22.  
  23.                 end
  24.  
  25.         end
  26.  
  27.         wait(1)
  28.  
  29. end
  30.  
  31. wait(2)
  32.  
  33. D_num = script.Parent.Parent.Parent.Quantity
  34.  
  35. while D_num.Value < 10 do
  36.  
  37.         if distance < 50 then
  38.  
  39.                 local Pirate = game.ServerStorage.Pirate:Clone()
  40.  
  41.                 Pirate.Parent = game.Workspace.NPC
  42.  
  43.                 local movement = math.random(-20, 20)
  44.  
  45.                 Pirate:MoveTo(script.Parent.Parent.SpawnPoint.Position + Vector3.new(movement,0,movement) )
  46.  
  47.                 D_num.Value += 1
  48.  
  49.         end
  50.  
  51.         local destination = game.Workspace.Data.Player.Value.Character.HumanoidRootPart.Position
  52.  
  53.         distance = (destination - script.Parent.Position).magnitude
  54.  
  55.         wait(5)
  56.  
  57. end
  58.  
  59.  
Advertisement
Add Comment
Please, Sign In to add comment