princeofheaven

Princes Custom

Jun 4th, 2015
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. hint = Instance.new("Hint",workspace)
  2. hint.Text = "Climbing game is about to begin.."
  3.  
  4. pos = 0
  5. for i=1, 90, 0.23 do
  6. local p = Instance.new("Part",workspace)
  7. p.Size = Vector3.new(30,1,3)
  8. p.Anchored = true
  9. p.CFrame = CFrame.new(20,pos,0) * CFrame.Angles(0,i,0)
  10. pos = pos + 1.2
  11. end
  12.  
  13. wait(2)
  14. hint.Text = "START!! 20 seconds."
  15.  
  16. for i=20,0,-1 do
  17. wait(1)
  18. hint.Text = "START!! "..i.." seconds."
  19. end
  20.  
  21. winner = nil
  22. value = nil
  23. values = {}
  24. guys = {}
  25. for _,v in pairs(game.Players:GetChildren()) do
  26. if v.Character then
  27. local torso = v.Character:findFirstChild("Torso")
  28. if torso then
  29. table.insert(values, torso.Position.Y)
  30. table.insert(guys, v)
  31. end
  32. end
  33. end
  34. for i=1, #guys do
  35. local val = math.max(unpack(values))
  36. if guys[i].Character.Torso.Position.Y == val then
  37. winner = guys[i].Name
  38. value = val
  39. end
  40. end
  41.  
  42. hint.Text = "The winner is "..winner.." with "..math.floor(value).." studs!"
Add Comment
Please, Sign In to add comment