Advertisement
Animescapetower

Better fall damage

Apr 21st, 2018
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.82 KB | None | 0 0
  1. --Created by XanthicDragon
  2.  
  3. local Players = game:GetService("Players")
  4. local Player = Players.LocalPlayer
  5. local Character = nil
  6. local damage = 0
  7. repeat
  8. wait()
  9. Character = Player.Character
  10. until Character ~= nil
  11.  
  12. --Getting into the 'technical' stuff--
  13.  
  14. function FindFirstClass(par, cls) --Finds a classname and returns that object.
  15. for _,v in ipairs(par:GetChildren()) do
  16. if v:IsA(cls) then
  17. return v
  18. end
  19. end
  20. return nil
  21. end
  22.  
  23. local Human = FindFirstClass(Character, "Humanoid") --Call the FindFirstClass function, checking the Character for a Human
  24. if not Human then
  25. print("Humanoid instance not found in Character! Checking again...")
  26. wait(1)
  27. local Human = FindFirstClass(Character, "Humanoid")
  28. if not Human then
  29. print("Human still not located. Stopping code.")
  30. return
  31. end
  32. end
  33.  
  34. function CreatePart()
  35. local SpecialMesh1 = Instance.new("SpecialMesh")
  36. local Part2 = Instance.new("Part")
  37. local SpecialMesh3 = Instance.new("SpecialMesh")
  38. Part0.Name = "BlastRing"
  39. Part0.Parent = Player.Character
  40. Part0.BrickColor = BrickColor.new("Dark orange")
  41. Part0.Transparency = 0.40000000596046
  42. Part0.Rotation = Vector3.new(0, 90, 0)
  43. Part0.Anchored = true
  44. Part0.CanCollide = false
  45. Part0.Size = Vector3.new(1, 1.20000005, 1)
  46. Part0.CFrame = CFrame.new(8.78331757, 456.780121, -49.041584, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  47. Part0.BottomSurface = Enum.SurfaceType.Smooth
  48. Part0.TopSurface = Enum.SurfaceType.Smooth
  49. Part0.Color = Color3.new(0.627451, 0.372549, 0.207843)
  50. Part0.Position = Vector3.new(8.78331757, 456.780121, -49.041584)
  51. Part0.Orientation = Vector3.new(0, 90, 0)
  52. Part0.Color = Color3.new(0.627451, 0.372549, 0.207843)
  53. SpecialMesh1.Name = "BlastMesh"
  54. SpecialMesh1.Parent = Part0
  55. SpecialMesh1.MeshId = "http://www.roblox.com/asset/?id=20329976"
  56. SpecialMesh1.Scale = Vector3.new(3.19999981, 1.4000001, 3.19999981)
  57. SpecialMesh1.MeshType = Enum.MeshType.FileMesh
  58. SpecialMesh1.Scale = Vector3.new(3.19999981, 1.4000001, 3.19999981)
  59. Part2.Name = "BlastRing"
  60. Part2.Parent = Player.Character
  61. Part2.BrickColor = BrickColor.new("Dark orange")
  62. Part2.Transparency = 0.30000001192093
  63. Part2.Rotation = Vector3.new(0, 54, 0)
  64. Part2.Anchored = true
  65. Part2.CanCollide = false
  66. Part2.Size = Vector3.new(1, 1.20000005, 1)
  67. Part2.CFrame = CFrame.new(8.78331757, 456.780121, -49.041584, 0.587785304, 0, 0.809017062, 0, 1, 0, -0.809017062, 0, 0.587785304)
  68. Part2.BottomSurface = Enum.SurfaceType.Smooth
  69. Part2.TopSurface = Enum.SurfaceType.Smooth
  70. Part2.Color = Color3.new(0.627451, 0.372549, 0.207843)
  71. Part2.Position = Vector3.new(8.78331757, 456.780121, -49.041584)
  72. Part2.Orientation = Vector3.new(0, 54, 0)
  73. Part2.Color = Color3.new(0.627451, 0.372549, 0.207843)
  74. SpecialMesh3.Name = "BlastMesh"
  75. SpecialMesh3.Parent = Part2
  76. SpecialMesh3.MeshId = "http://www.roblox.com/asset/?id=20329976"
  77. SpecialMesh3.Scale = Vector3.new(2.89999986, 1.30000007, 2.89999986)
  78. SpecialMesh3.MeshType = Enum.MeshType.FileMesh
  79. SpecialMesh3.Scale = Vector3.new(2.89999986, 1.30000007, 2.89999986)
  80.  
  81.  
  82. for n = 1,12 do
  83. Part2.Size = Part2.Size + Vector3.new(1,1,1)
  84. Part0.Size = Part0.Size + Vector3.new(0.7,0.7,0.7)
  85. Part2.Transparency = Part2.Transparency + 0.02
  86. Part0.Transparency = Part0.Transparency + 0.01
  87. Part2.Position = Player.Character.Torso.Position
  88. Part0.Position = Part2.Position
  89. wait(0.00)
  90.  
  91. end
  92. Part2:Destroy()
  93. Part0:Destroy()
  94.  
  95.  
  96. end
  97.  
  98.  
  99. while wait() do
  100. Torso = Character:WaitForChild("Torso")
  101. if Torso.Velocity.Magnitude > 75 then --Farily simple. Check if we're going faster than 75 units, and add to damage.
  102. damage = damage + 9 * 0.31--Real amount of fall damege a human would take if he fall off a something
  103.  
  104. else
  105. Part0 = Instance.new("Part")
  106.  
  107.  
  108. Human:TakeDamage(damage)
  109.  
  110. damage = 0
  111.  
  112. Humanoid = game.Players.LocalPlayer.Character.Humanoid
  113.  
  114.  
  115. Humanoid.HealthChanged:connect(CreatePart)
  116.  
  117. end
  118. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement