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.Smoke.Enabled = true
- script.Parent.Parent.SpawnPoint.Smoke.Size = 10
- script.Parent.Parent.SpawnPoint.Smoke.RiseVelocity = 10
- script.Parent.Parent.SpawnPoint.Smoke.Opacity = 1
- 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 Pirate = game.ServerStorage.Pirate:Clone()
- Pirate.Parent = game.Workspace.NPC
- local movement = math.random(-20, 20)
- Pirate:MoveTo(script.Parent.Parent.SpawnPoint.Position + Vector3.new(movement,0,movement) )
- D_num.Value += 1
- end
- local destination = game.Workspace.Data.Player.Value.Character.HumanoidRootPart.Position
- distance = (destination - script.Parent.Position).magnitude
- wait(5)
- end
Advertisement
Add Comment
Please, Sign In to add comment