NSKuber

Exercise 1 Bonus

Mar 31st, 2021 (edited)
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.50 KB | None | 0 0
  1. Wait(Delay(1))
  2. local AllPlayers = worldInfo:GetAllPlayersInRange(worldInfo,100000)
  3. for i = 1, #AllPlayers, 1 do
  4.   AllPlayers[i]:DropDead(0,0,0)
  5. end
  6.  
  7. or
  8.  
  9. Wait(Delay(1))
  10. local AllPlayers = worldInfo:GetAllPlayersInRange(worldInfo,100000)
  11. for _,player in pairs(AllPlayers) do
  12.   player:DropDead(0,0,0)
  13. end
  14.  
  15. Note: the 'pairs' function is used to iterate over the key-value pairs of a table. Here '_' is used as a dummy variable for a key (number) which I don't need, and the value is put into 'player'.
Add Comment
Please, Sign In to add comment