Hasli4

RBLX. DemonSpawner

May 12th, 2025 (edited)
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.80 KB | None | 0 0
  1. working = true
  2. local distance = 0
  3. while working do
  4.     for _, player in pairs(game.Players:GetPlayers()) do
  5.         distance = player:DistanceFromCharacter(script.Parent.Position)
  6.         if (distance > 0) and (distance < 50) then
  7.             working = false
  8.             script.Parent.Parent.SpawnPoint.Fire.Enabled = true
  9.             script.Parent.Parent.SpawnPoint.Fire.Size = 100
  10.         end
  11.     end
  12.     wait(1)
  13. end
  14. wait(2)
  15. D_num = script.Parent.Parent.Parent.Quantity
  16. while D_num.Value < 10 do
  17.     if distance < 50 then
  18.         local Demon = game.ServerStorage.Demon:Clone()
  19.         Demon.Parent = game.Workspace.NPC
  20.         Demon:MoveTo(script.Parent.Parent.SpawnPoint.Position )
  21.         D_num.Value += 1
  22.     end
  23.     local destination = game.Workspace.Data.Player.Value.Character.HumanoidRootPart.Position
  24.     distance = (destination - script.Parent.Position).magnitude
  25.     wait(5)
  26. end
  27.  
Add Comment
Please, Sign In to add comment