Advertisement
Overhaleren

The First Revenant

Apr 29th, 2016
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local player = game.Players.overhaleren
  2. local char = player.Character
  3.  
  4. -- Body parts
  5. local torso = char.Torso
  6.  
  7. -- Tool declarations
  8. local mouseDown = false
  9. local keysDown = {}
  10.  
  11. -- Earth bending declarations
  12. local raisingEarth = false
  13. local raisingTower = false
  14. local wall = false
  15. local groundAttack = false
  16. local lastTower = nil
  17. local disabled = {}
  18. local frames = {}
  19. local parts = {}
  20. local Taunts = {"Die already!", "DIE, DIE, DIE!", "HRRAAAA!", "I told you it's useless!", "You will not be the first to die by my hand!", "You will suffer!", "Don't try to evade the inevitable!", "I will tear you apart!","You are pathetic!","You will never defeat me!","I AM GOD!"}
  21. local raisechats = {"I will make you realize the depth of my power, even if I have to grind your body into dust!","I suggest you run.", "Now you're just pissing me off.", "Hmph.", "It's useless.",".....", "Your life ends here!","Foolish!","Do you know who I am?","What stupidity.","Hmm.","Hmph. Your confidence is annoying.","You cannot kill a god."}
  22.  
  23. -- Main
  24. function main(mouse)
  25. while true do wait(1/30)
  26. local look = CFrame.new(torso.Position, torso.Position + mouse.Hit.lookVector)
  27.  
  28. -- Reset parts
  29. parts = {}
  30.  
  31. -- Get parts
  32. for x = -20, 20, 10 do
  33. for y = -20, 20, 10 do
  34. for z = -30, -10, 10 do
  35. local pos = look * Vector3.new(x, y, z)
  36. getPartsInRegion3(
  37. Region3.new(
  38. pos + Vector3.new(1,1,1)*-9,
  39. pos + Vector3.new(1,1,1)* 9
  40. ),
  41. parts
  42. )
  43. end
  44. end
  45. end
  46.  
  47. -- Mouse down
  48. if mouseDown then
  49. -- Create dif and bodies
  50. for _, part in pairs(parts) do
  51. if part.Name == "Earth" and not disabled[part] then
  52. if not frames[part] and part ~= lastTower then
  53. frames[part] = look:toObjectSpace(part.CFrame)
  54.  
  55. part:ClearAllChildren()
  56. part.Anchored = false
  57.  
  58. -- Create bodies
  59. createBody("Position", part)
  60. createBody("Gyro", part)
  61. end
  62. end
  63. end
  64.  
  65. -- Move bodies
  66. for part in pairs(frames) do
  67. local bodyPos = part:FindFirstChild("BodyPosition")
  68. local bodyGyr = part:FindFirstChild("BodyGyro")
  69.  
  70. -- Bodies exist
  71. if bodyPos and bodyGyr then
  72. local dif = look * frames[part]
  73.  
  74. bodyPos.position = dif.p
  75. bodyGyr.cframe = dif
  76. else
  77. frames[part] = nil
  78. end
  79. end
  80. else
  81. for part in pairs(frames) do
  82. if part.Name == "Earth" then
  83. frames[part] = nil
  84.  
  85. part:ClearAllChildren()
  86. end
  87. end
  88. end
  89. end
  90. end
  91.  
  92. -- On key change
  93. function onKeyChange(mouse, key, state)
  94. -- Raise earth
  95. if key == "e" and state and not raisingEarth then
  96. game:GetService("Chat"):Chat(char.Head, raisechats[math.random(1,#raisechats)], Enum.ChatColor.Red)
  97. raisingEarth = true
  98. while keysDown[key] do
  99. local torsoY = torso.Position.y + 3
  100. local pos = planeY(torso.Position, 0.4 - 4/2)
  101. local dir = planeY(mouse.Hit.lookVector).unit
  102. local frame = CFrame.new(pos, pos + dir) * CFrame.new(r(-10, 10), 0, r(-20, -5))
  103.  
  104. -- Create earth part
  105. local part = createEarth(workspace)
  106. part.Anchored = true
  107. part.Size = Vector3.new(4, 4, 4)
  108. disabled[part] = true
  109.  
  110. -- Raise earth
  111. for i = 1, 4 do i = i/4
  112. part.CFrame = frame * CFrame.new(0, (torsoY - frame.y)*i, 0)
  113. wait(1/10000000)
  114. if not part.Anchored then
  115. break
  116. end
  117. end
  118.  
  119. disabled[part] = nil
  120. part.Anchored = false
  121.  
  122. wait(1/100)
  123. end
  124. raisingEarth = false
  125.  
  126.  
  127.  
  128.  
  129.  
  130. elseif key == "c" and state and not raisingEarth then
  131. game:GetService("Chat"):Chat(char.Head, raisechats[math.random(1,#raisechats)], Enum.ChatColor.Red)
  132. raisingEarth = true
  133. while keysDown[key] do
  134. local torsoY = torso.Position.y + 3
  135. local pos = planeY(torso.Position, 0.4 - 4/2)
  136. local dir = planeY(mouse.Hit.lookVector).unit
  137. local frame = CFrame.new(pos, pos + dir) * CFrame.new(r(-10, 10), 0, r(-20, -5))
  138.  
  139. -- Create earth part
  140. local part = createEarth(workspace)
  141. part.Anchored = true
  142. part.Size = Vector3.new(2, 2, 2)
  143. disabled[part] = true
  144.  
  145. -- Raise earth
  146. for i = 1, 4 do i = i/4
  147. part.CFrame = frame * CFrame.new(0, (torsoY - frame.y)*i, 0)
  148. wait(1/10000000)
  149. if not part.Anchored then
  150. break
  151. end
  152. end
  153.  
  154. disabled[part] = nil
  155. part.Anchored = false
  156.  
  157. wait(1/100)
  158. end
  159. raisingEarth = false
  160.  
  161.  
  162.  
  163. -- Push earth
  164. elseif key == "f" and state then
  165. game:GetService("Chat"):Chat(char.Head, Taunts[math.random(1,#Taunts)], Enum.ChatColor.Red)
  166. for _, part in pairs(parts) do
  167. if part.Name == "Earth" and part ~= lastTower then
  168. part:ClearAllChildren()
  169. part.Anchored = false
  170.  
  171. -- Add force
  172. local bodyForce = createBody("Force", part)
  173. bodyForce.force = mouse.Hit.lookVector*1.5e4 * part:GetMass()
  174.  
  175. game.Debris:AddItem(bodyForce, 1/30)
  176.  
  177. -- Disable part
  178. disabled[part] = true
  179. delay(1, function()
  180. disabled[part] = nil
  181. end)
  182. end
  183. end
  184.  
  185. -- Monster Ability
  186. elseif key == "m" and state then
  187. wait(.1)
  188. f = Instance.new("Fire")
  189. f.Parent = char.Head
  190. f.Color = Color3.new(0.7,0.5,0.9)
  191. f.Size = 5
  192. f.Heat = 5
  193. wait(.1)
  194. g = Instance.new("Fire")
  195. g.Parent = char["Right Arm"]
  196. g.Color = Color3.new(0.7,0.5,0.9)
  197. g.Size = 5
  198. g.Heat = 5
  199. wait(.1)
  200. h = Instance.new("Fire")
  201. h.Parent = char["Left Arm"]
  202. h.Color = Color3.new(0.7,0.5,0.9)
  203. h.Size = 5
  204. h.Heat = 5
  205. wait(.1)
  206. z = Instance.new("Sound")
  207. z.Parent = game.Workspace
  208. z.SoundId = "http://www.roblox.com/asset/?id=159365911"
  209. z.Looped = false
  210. z.Volume = 1
  211. z.Pitch = 0.65
  212. wait(1.8)
  213. game:GetService("Chat"):Chat(char.Head, "Hmph.", Enum.ChatColor.Red)
  214. wait(3.4)
  215. game:GetService("Chat"):Chat(char.Head, "This has become a pointless battle.", Enum.ChatColor.Red)
  216. wait(2.4)
  217. game:GetService("Chat"):Chat(char.Head, "I will end this quickly", Enum.ChatColor.Red)
  218. wait(.1)
  219. z:Play()
  220. char.Humanoid.MaxHealth = 900000000
  221. wait(1)
  222. char.Humanoid.Health = 900000000
  223. wait(182)
  224. char.Humanoid.MaxHealth = 600
  225. z:Remove()
  226. f:Remove()
  227. g:Remove()
  228. h:Remove()
  229.  
  230. -- N-Rage
  231. elseif key == "n" and state then
  232. c = Instance.new("Sound")
  233. c.Parent = game.Workspace
  234. c.SoundId = "http://www.roblox.com/asset/?id=157747165"
  235. c.Looped = false
  236. c.Volume = 1
  237. c.Pitch = .7
  238. wait(1.8)
  239. game:GetService("Chat"):Chat(char.Head, "What the hell was that?", Enum.ChatColor.Red)
  240. wait(2)
  241. game:GetService("Chat"):Chat(char.Head, "Did you actually believe you could harm me?", Enum.ChatColor.Red)
  242. wait(2.4)
  243. game:GetService("Chat"):Chat(char.Head, "If you would simply let yourself die, you would not have to go through this pointless suffering.", Enum.ChatColor.Red)
  244. wait(3.5)
  245. game:GetService("Chat"):Chat(char.Head, "All you have done is waste my time.", Enum.ChatColor.Red)
  246. wait(.1)
  247. c:Play()
  248. char.Humanoid.MaxHealth = math.huge
  249. wait(160)
  250. char.Humanoid.MaxHealth = 10000
  251. c:Remove()
  252.  
  253. -- Break earth
  254. elseif key == "b" and state then
  255. game:GetService("Chat"):Char(char.Head, "Hmph.", Enum.ChatColor.Red)
  256. wait(.01)
  257. for part in pairs(frames) do
  258. if part.Size == Vector3.new(4, 4, 4) then
  259. for x = -1, 2, 2 do
  260. for y = -1, 2, 2 do
  261. for z = -1, 1, 2 do
  262. local oPart = createEarth(workspace)
  263. oPart.Size = Vector3.new(2, 2, 2)
  264. oPart.CFrame = part.CFrame * CFrame.new(x*1.1, y*1.1, z*1.1)
  265. end
  266. end
  267. end
  268. part:Destroy()
  269. end
  270.  
  271. end
  272.  
  273. for part in pairs(frames) do
  274. if part.Size == Vector3.new(25, 15, 25) then
  275. for x = -3, 2, 2 do
  276. for y = -3, 2, 2 do
  277. for z = -3, 1, 2 do
  278. local oPart = createEarth(workspace)
  279. oPart.Size = Vector3.new(2, 2, 2)
  280. oPart.CFrame = part.CFrame * CFrame.new(x*1.1, y*1.1, z*1.1)
  281. end
  282. end
  283. end
  284. part:Destroy()
  285. end
  286.  
  287. end
  288.  
  289. for part in pairs(frames) do
  290. if part.Size == Vector3.new(2, 2, 2) then
  291. for x = -0.5, 2, 2 do
  292. for y = -0.5, 2, 2 do
  293. for z = -0.5, 1, 2 do
  294. local oPart = createEarth(workspace)
  295. oPart.Size = Vector3.new(1, 1, 1)
  296. oPart.CFrame = part.CFrame * CFrame.new(x*1.1, y*1.1, z*1.1)
  297. end
  298. end
  299. end
  300. part:Destroy()
  301. end
  302.  
  303. end
  304.  
  305.  
  306.  
  307.  
  308. -- Raise tower
  309. elseif key == "r" and state and not raisingTower then
  310. game:GetService("Chat"):Chat(char.Head, raisechats[math.random(1,#raisechats)], Enum.ChatColor.Red)
  311. raisingTower = true
  312. lastTower = nil
  313. if torso.Position.y - 5/2 < 20.4 then
  314. local part = createEarth(workspace)
  315. part.Anchored = true
  316. disabled[part] = true
  317.  
  318. for i = 0, 20, 4 do
  319. part.Size = Vector3.new(5, i, 5)
  320. part.CFrame = CFrame.new(torso.Position.x, 0.4 + part.Size.y/2, torso.Position.z)
  321. torso.CFrame = (torso.CFrame - torso.CFrame.p) + Vector3.new(torso.Position.x, part.Position.y + part.Size.y/2 + 5/2, torso.Position.z)
  322. wait(1/30)
  323. end
  324.  
  325. lastTower = part
  326.  
  327. disabled[part] = nil
  328. part.Anchored = false
  329. end
  330. raisingTower = false
  331.  
  332.  
  333. -- Raise wall
  334. elseif key == "t" and state and not wall then
  335. game:GetService("Chat"):Chat(char.Head, raisechats[math.random(1,#raisechats)], Enum.ChatColor.Red)
  336. wall = true
  337. lastWall = nil
  338. if torso.Position.y - 5/2 < 20.4 then
  339. local part = createEarth(workspace)
  340. part.Anchored = true
  341. disabled[part] = true
  342.  
  343. for i = 0, 1, 20 do
  344. part.Size = Vector3.new(25, 15, 25)
  345. part.CFrame = CFrame.new(torso.Position.x, 0.4 + part.Size.y/2, torso.Position.z)
  346. torso.CFrame = (torso.CFrame - torso.CFrame.p) + Vector3.new(torso.Position.x, part.Position.y + part.Size.y/2 + 5/2, torso.Position.z)
  347. wait(1/30)
  348. end
  349.  
  350. lastWall = part
  351.  
  352. disabled[part] = nil
  353. part.Anchored = false
  354. end
  355. wall = false
  356.  
  357. -- Ground attack
  358. elseif key == "g" and state and not groundAttack then
  359. game:GetService("Chat"):Chat(char.Head, Taunts[math.random(1,#Taunts)], Enum.ChatColor.Red)
  360. groundAttack = true
  361. delay(1, function()
  362. groundAttack = false
  363. end)
  364.  
  365. local dir = planeY(mouse.Hit.p - torso.Position).unit
  366. local pos = planeY(torso.Position, 0.4 + 1) + dir*5
  367.  
  368. local ground = {}
  369.  
  370. delay(5, function()
  371. for i = 1, 20 do
  372. for _, part in pairs(ground) do
  373. if part.Anchored then
  374. part.CFrame = part.CFrame + Vector3.new(0, -1/7, 0)
  375. end
  376. end
  377. wait(1/30)
  378. end
  379. for _, part in pairs(ground) do
  380. if part.Anchored then
  381. part:Destroy()
  382. end
  383. end
  384. end)
  385.  
  386. for i = 1, 10 do
  387. local hit, pos2 = rayCast(pos, dir*5, {char})
  388.  
  389. local part = createEarth(workspace)
  390. part.Anchored = true
  391. part.Size = Vector3.new(4, 4, 4)
  392. part.CFrame = CFrame.new(pos2, pos2 + dir) * CFrame.Angles(math.rad(-50), 0, 0) + Vector3.new(0, -0, 0)
  393.  
  394. ground[#ground + 1] = part
  395.  
  396. -- Add force
  397. if hit then
  398. local mass = hit:GetMass()
  399.  
  400. -- Hit player
  401. for _, oPlayer in pairs(game.Players:GetPlayers()) do
  402. if oPlayer.Character and oPlayer.Character:FindFirstChild("Torso") and hit:IsDescendantOf(oPlayer.Character) then
  403. hit = oPlayer.Character.Torso
  404. mass = 20
  405. end
  406. end
  407.  
  408. if hit.Name ~= "Torso" then
  409. hit:ClearAllChildren()
  410. end
  411. hit.Anchored = false
  412.  
  413. -- Add force
  414. local bodyForce = createBody("Force", hit)
  415. bodyForce.force = (dir + Vector3.new(0, 0.2, 0)).unit*1e4 * mass
  416.  
  417. game.Debris:AddItem(bodyForce, 1/30)
  418. break
  419. end
  420.  
  421. pos = pos2
  422. wait(1/20)
  423. end
  424. end
  425. end
  426.  
  427. --- CORE CODE BELOW --- CORE CODE BELOW --- CORE CODE BELOW ---
  428. --- CORE CODE BELOW --- CORE CODE BELOW --- CORE CODE BELOW ---
  429. --- CORE CODE BELOW --- CORE CODE BELOW --- CORE CODE BELOW ---
  430.  
  431. -- Clear old tool
  432. player.Backpack:ClearAllChildren()
  433.  
  434. -- Create tool
  435. local tool = Instance.new("HopperBin")
  436. tool.Parent = player.Backpack
  437. tool.Name = "Dark Bending"
  438.  
  439. -- Tool selected
  440. tool.Selected:connect(function(mouse)
  441. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  442.  
  443. -- Mouse events
  444. mouse.Button1Down:connect(function()
  445. mouseDown = true
  446. end)
  447. mouse.Button1Up:connect(function()
  448. mouseDown = false
  449. end)
  450. mouse.KeyDown:connect(function(key)
  451. keysDown[key:lower()] = true
  452. onKeyChange(mouse, key:lower(), true)
  453. end)
  454. mouse.KeyUp:connect(function(key)
  455. keysDown[key:lower()] = false
  456. onKeyChange(mouse, key:lower(), false)
  457. end)
  458.  
  459. -- Call main
  460. main(mouse)
  461. end)
  462.  
  463. --- LIBRARY BELOW --- LIBRARY BELOW --- LIBRARY BELOW ---
  464. --- LIBRARY BELOW --- LIBRARY BELOW --- LIBRARY BELOW ---
  465. --- LIBRARY BELOW --- LIBRARY BELOW --- LIBRARY BELOW ---
  466.  
  467. -- Ray cast
  468. function rayCast(pos, dir, ignore)
  469. return workspace:FindPartOnRayWithIgnoreList(Ray.new(pos, dir), ignore)
  470. end
  471.  
  472. -- Create body
  473. function createBody(type, path)
  474. local body = Instance.new("Body" .. type)
  475. if type == "Gyro" then
  476. body.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  477. elseif type ~= "Force" then
  478. body.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  479. end
  480. body.Parent = path
  481. return body
  482. end
  483.  
  484. -- Get parts in region 3
  485. function getPartsInRegion3(region, parts)
  486. repeat
  487. local regParts = workspace:FindPartsInRegion3WithIgnoreList(region, parts, 100)
  488. for i, part in pairs(regParts) do
  489. parts[#parts + 1] = part
  490. end
  491. until #regParts < 100
  492. end
  493.  
  494. -- Random
  495. function r(min, max)
  496. return math.random()*(max - min) + min
  497. end
  498.  
  499. -- Plane y
  500. function planeY(v, y)
  501. return Vector3.new(v.x, y or 0, v.z)
  502. end
  503.  
  504. -- Create earth
  505. function createEarth(path)
  506. local part = createPart("Earth", path)
  507. part.BrickColor = BrickColor.new("Really black")
  508. part.Material = "Slate"
  509. m = Instance.new("Fire",part)
  510. m.Heat = 10
  511. part.Parent = path
  512. return part
  513. end
  514.  
  515. -- Create part
  516. function createPart(name, path)
  517. local part = Instance.new("Part")
  518. part.FormFactor = "Symmetric"
  519. part.BottomSurface = "Smooth"
  520. part.TopSurface = "Smooth"
  521. part.Size = Vector3.new(1, 1, 1)
  522. part.Name = name
  523. part.Parent = path
  524. return part
  525. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement