Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- working = true
- local distance = 0
- while working do
- for _, player in pairs(game.Players:GetPlayers()) do
- distance = player:DistanceFromCharacter(script.Parent.Position)
- if (distance > 0) and (distance < 50) then
- working = false
- script.Parent.Parent.SpawnPoint.Fire.Enabled = true
- script.Parent.Parent.SpawnPoint.Fire.Size = 100
- end
- end
- wait(1)
- end
- wait(2)
- D_num = script.Parent.Parent.Parent.Quantity
- while D_num.Value < 10 do
- if distance < 50 then
- local Demon = game.ServerStorage.Demon:Clone()
- Demon.Parent = game.Workspace.NPC
- Demon:MoveTo(script.Parent.Parent.SpawnPoint.Position )
- D_num.Value += 1
- end
- local destination = game.Workspace.Data.Player.Value.Character.HumanoidRootPart.Position
- distance = (destination - script.Parent.Position).magnitude
- wait(5)
- end
Add Comment
Please, Sign In to add comment