Advertisement
CrastAndNoob

Jumping Simulator Script v1

Dec 3rd, 2019
601
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.32 KB | None | 0 0
  1. function setup(plr)
  2. local c1 = coroutine.wrap(function()
  3. local ls = Instance.new("Folder",plr)
  4. ls.Name = "leaderstats"
  5. local jm = Instance.new("NumberValue",ls)
  6. jm.Name = "JumpMoney"
  7. jm.Value = 0
  8. local jp = Instance.new("NumberValue",ls)
  9. jp.Name = "Power"
  10. jp.Value = 25
  11. local rb = Instance.new("NumberValue",ls)
  12. rb.Name = "Rebirths"
  13. rb.Value = 0
  14. local powerCost = 10
  15. local rebirthCost = 25000
  16. plr.CharacterAdded:connect(function(char)
  17. wait()
  18. local hum = char:FindFirstChildOfClass("Humanoid")
  19. local c2 = coroutine.wrap(function()
  20. while true do
  21. ypcall(function()hum.JumpPower=jp.Value end)
  22. wait()
  23. end
  24. end) c2()
  25. hum.Jumping:connect(function()
  26. jm.Value = jm.Value + (jp.Value-24)*(rb.Value+1)
  27. end)
  28. end)
  29. plr.Chatted:connect(function(msg)
  30. local msg2 = msg:lower()
  31. if string.sub(msg2,1,8)=="/upgrade"then
  32. if jm.Value>(powerCost-1)then
  33. local hint = Instance.new("Hint",plr.PlayerGui)
  34. hint.Text = "Successfully purchased Power Upgrade for "..powerCost..". Your jump power is now "..(jp.Value+2).."."
  35. jm.Value = jm.Value - powerCost
  36. jp.Value = jp.Value + 2
  37. powerCost = math.floor(powerCost*1.5)
  38. wait(3)
  39. hint.Text = ""
  40. hint:Destroy()
  41. else
  42. local hint = Instance.new("Hint",plr.PlayerGui)
  43. hint.Text = "You need "..(powerCost-jm.Value).." more J$ to buy a Power Upgrade."
  44. wait(3)
  45. hint.Text = ""
  46. hint:Destroy()
  47. end
  48. end
  49. if string.sub(msg2,1,8)=="/rebirth"then
  50. if jm.Value>(rebirthCost-1)then
  51. local hint = Instance.new("Hint",plr.PlayerGui)
  52. hint.Text = "Successfully purchased Rebirth for "..rebirthCost.."!"
  53. jm.Value = 0
  54. jp.Value = 25
  55. powerCost = math.floor(10+(rb.Value*1.2))
  56. rebirthCost = math.floor(rebirthCost*1.75)
  57. rb.Value = rb.Value + 1
  58. wait(3)
  59. hint.Text = ""
  60. hint:Destroy()
  61. else
  62. local hint = Instance.new("Hint",plr.PlayerGui)
  63. hint.Text = "You need "..(rebirthCost-jm.Value).." more J$ to rebirth."
  64. wait(3)
  65. hint.Text = ""
  66. hint:Destroy()
  67. end
  68. end
  69. end)
  70. plr:LoadCharacter()
  71. end) c1()
  72. end
  73.  
  74. game:GetService("Players").PlayerAdded:connect(function(plr)
  75. setup(plr)
  76. end)
  77.  
  78. for _,i in pairs(game:GetService("Players"):GetPlayers())do
  79. setup(i)
  80. wait()
  81. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement