Advertisement
Guest User

Untitled

a guest
Aug 1st, 2014
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.30 KB | None | 0 0
  1. function GetMap()
  2. maps={"Map1","Map2","Map3","Map4","map5"}
  3. randommap=math.random(1,#maps)
  4. themap=game.Lighting:FindFirstChild(maps[randommap])
  5. message=Instance.new("Message")
  6. message.Name="Broadcast"
  7. message.Parent=game.Workspace
  8. message.Text="Map selected is: "..themap.Name..", get ready!"
  9. --countdown
  10. themap.Parent=game.Workspace
  11. for i=1,5 do
  12. wait(1)
  13. message.Text=5-i
  14. end
  15. message.Text=""
  16. getplayers=game.Players:GetChildren()
  17. for p=1,#players do
  18. character=game.Workspace:FindFirstChild(getplayers[p].Name)
  19. if character~=nil then
  20. spawns={"Spawn1","Spawn2","Spawn3","Spawn4","Spawn5","Spawn6","Spawn7"}
  21. TheSpawn = themap:FindFirstChild(spawns[math.random(1,#spawns)])
  22. if TheSpawn ~= nil then
  23. SX = TheSpawn.Position.X
  24. SY = TheSpawn.Position.Y
  25. SZ = TheSpawn.Position.Z
  26. RX = math.random(-10,10)
  27. RZ = math.random(-10,10)
  28. if character~=nil then
  29. thecharactertorso=character:FindFirstChild("Torso")
  30. thecharacter:moveTo(Vector3.new(SX + RX,SY + 6,SZ + RZ))
  31. end
  32. end
  33. end
  34. end
  35. wait(60)
  36. message.Text="Round Over!"
  37. Players = game.Players:GetChildren()
  38. themap:remove()
  39. for i = 1, #Players do
  40. if Players[i].Character:FindFirstChild("IsAlive") then
  41. Players[i].leaderstats.Points.Value = Players[i].leaderstats.Points.Value + 1 + (playerkills.Value * 4)
  42. Players[i].playerkills.Value = 10
  43. end
  44. end
  45. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement