Advertisement
Ashie

Irons earth powers

Jun 12th, 2018
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. disabled[part] = true
  3.  
  4. -- Raise earth
  5. for i = 1, 4 do i = i/4
  6. part.CFrame = frame * CFrame.new(0, (torsoY - frame.y)*i, 0)
  7. wait(1/10000000)
  8. if not part.Anchored then
  9. break
  10. end
  11. end
  12.  
  13. disabled[part] = nil
  14. part.Anchored = false
  15.  
  16. wait(1/100)
  17. end
  18. raisingEarth = false
  19.  
  20.  
  21.  
  22.  
  23.  
  24. elseif key == "c" and state and not raisingEarth then
  25. game:GetService("Chat"):Chat(char.Head, raisechats[math.random(1,#raisechats)], Enum.ChatColor.Red)
  26. raisingEarth = true
  27. while keysDown[key] do
  28. local torsoY = torso.Position.y + 3
  29. local pos = planeY(torso.Position, 0.4 - 4/2)
  30. local dir = planeY(mouse.Hit.lookVector).unit
  31. local frame = CFrame.new(pos, pos + dir) * CFrame.new(r(-10, 10), 0, r(-20, -5))
  32.  
  33. -- Create earth part
  34. local part = createEarth(workspace)
  35. part.Anchored = true
  36. part.Size = Vector3.new(2, 2, 2)
  37. disabled[part] = true
  38.  
  39. -- Raise earth
  40. for i = 1, 4 do i = i/4
  41. part.CFrame = frame * CFrame.new(0, (torsoY - frame.y)*i, 0)
  42. wait(1/10000000)
  43. if not part.Anchored then
  44. break
  45. end
  46. end
  47.  
  48. disabled[part] = nil
  49. part.Anchored = false
  50.  
  51. wait(1/100)
  52. end
  53. raisingEarth = false
  54.  
  55.  
  56.  
  57. -- Push earth
  58. elseif key == "f" and state then
  59. game:GetService("Chat"):Chat(char.Head, Taunts[math.random(1,#Taunts)], Enum.ChatColor.Red)
  60. for _, part in pairs(parts) do
  61. if part.Name == "Earth" and part ~= lastTower then
  62. part:ClearAllChildren()
  63. part.Anchored = false
  64.  
  65. -- Add force
  66. local bodyForce = createBody("Force", part)
  67. bodyForce.force = mouse.Hit.lookVector*1.5e4 * part:GetMass()
  68.  
  69. game.Debris:AddItem(bodyForce, 1/30)
  70.  
  71. -- Disable part
  72. disabled[part] = true
  73. delay(1, function()
  74. disabled[part] = nil
  75. end)
  76. end
  77. end
  78.  
  79. -- Monster Ability
  80. elseif key == "m" and state then
  81. wait(.1)
  82. f = Instance.new("Fire")
  83. f.Parent = char.Head
  84. f.Color = Color3.new(0.8,0.4,0)
  85. f.Size = 5
  86. f.Heat = 5
  87. wait(.1)
  88. g = Instance.new("Fire")
  89. g.Parent = char["Right Arm"]
  90. g.Color = Color3.new(0.8,0.4,0)
  91. g.Size = 5
  92. g.Heat = 5
  93. wait(.1)
  94. h = Instance.new("Fire")
  95. h.Parent = char["Left Arm"]
  96. h.Color = Color3.new(0.8,0.4,0)
  97. h.Size = 5
  98. h.Heat = 5
  99. wait(.1)
  100. z = Instance.new("Sound")
  101. z.Parent = game.Workspace
  102. z.SoundId = "http://www.roblox.com/asset/?id=410533850"
  103. z.Looped = True
  104. z.Volume = 10
  105. z.Pitch = 1
  106. wait(1.8)
  107. game:GetService("Chat"):Chat(char.Head, "Hmph.", Enum.ChatColor.Red)
  108. wait(3.4)
  109. game:GetService("Chat"):Chat(char.Head, "This has become a pointless battle.", Enum.ChatColor.Red)
  110. wait(2.4)
  111. game:GetService("Chat"):Chat(char.Head, "I will end this quickly", Enum.ChatColor.Red)
  112. wait(.1)
  113. z:Play()
  114. char.Humanoid.MaxHealth = 9999999999999999999
  115. wait(1)
  116. char.Humanoid.Health = 9999999999999999999
  117. wait(182)
  118. char.Humanoid.MaxHealth = 9999999999999999999
  119. z:Remove()
  120. f:Remove()
  121. g:Remove()
  122. h:Remove()
  123.  
  124. -- N-Rage
  125. elseif key == "n" and state then
  126. c = Instance.new("Sound")
  127. c.Parent = game.Workspace
  128. c.Looped = false
  129. c.Volume = 1
  130. c.Pitch = .7
  131. wait(1.8)
  132. game:GetService("Chat"):Chat(char.Head, "What the hell was that?", Enum.ChatColor.Red)
  133. wait(2)
  134. game:GetService("Chat"):Chat(char.Head, "Did you actually believe you could harm me?", Enum.ChatColor.Red)
  135. wait(2.4)
  136. 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)
  137. wait(3.5)
  138. game:GetService("Chat"):Chat(char.Head, "All you have done is waste my time.", Enum.ChatColor.Red)
  139. wait(.1)
  140. c:Play()
  141. char.Humanoid.MaxHealth = 9999999999999999999
  142. wait(160)
  143. char.Humanoid.MaxHealth = 9999999999999999999
  144. c:Remove()
  145.  
  146. -- Break earth
  147. elseif key == "b" and state then
  148. game:GetService("Chat"):Char(char.Head, "Hmph.", Enum.ChatColor.Red)
  149. wait(.01)
  150. for part in pairs(frames) do
  151. if part.Size == Vector3.new(4, 4, 4) then
  152. for x = -1, 2, 2 do
  153. for y = -1, 2, 2 do
  154. for z = -1, 1, 2 do
  155. local oPart = createEarth(workspace)
  156. oPart.Size = Vector3.new(2, 2, 2)
  157. oPart.CFrame = part.CFrame * CFrame.new(x*1.1, y*1.1, z*1.1)
  158. end
  159. end
  160. end
  161. part:Destroy()
  162. end
  163.  
  164. end
  165.  
  166. for part in pairs(frames) do
  167. if part.Size == Vector3.new(25, 15, 25) then
  168. for x = -3, 2, 2 do
  169. for y = -3, 2, 2 do
  170. for z = -3, 1, 2 do
  171. local oPart = createEarth(workspace)
  172. oPart.Size = Vector3.new(2, 2, 2)
  173. oPart.CFrame = part.CFrame * CFrame.new(x*1.1, y*1.1, z*1.1)
  174. end
  175. end
  176. end
  177. part:Destroy()
  178. end
  179.  
  180. end
  181.  
  182. for part in pairs(frames) do
  183. if part.Size == Vector3.new(2, 2, 2) then
  184. for x = -0.5, 2, 2 do
  185. for y = -0.5, 2, 2 do
  186. for z = -0.5, 1, 2 do
  187. local oPart = createEarth(workspace)
  188. oPart.Size = Vector3.new(1, 1, 1)
  189. oPart.CFrame = part.CFrame * CFrame.new(x*1.1, y*1.1, z*1.1)
  190. end
  191. end
  192. end
  193. part:Destroy()
  194. end
  195.  
  196. end
  197.  
  198.  
  199.  
  200.  
  201. -- Raise tower
  202. elseif key == "r" and state and not raisingTower then
  203. game:GetService("Chat"):Chat(char.Head, raisechats[math.random(1,#raisechats)], Enum.ChatColor.Red)
  204. raisingTower = true
  205. lastTower = nil
  206. if torso.Position.y - 5/2 < 20.4 then
  207. local part = createEarth(workspace)
  208. part.Anchored = true
  209. disabled[part] = true
  210.  
  211. for i = 0, 20, 4 do
  212. part.Size = Vector3.new(5, i, 5)
  213. part.CFrame = CFrame.new(torso.Position.x, 0.4 + part.Size.y/2, torso.Position.z)
  214. torso.CFrame = (torso.CFrame - torso.CFrame.p) + Vector3.new(torso.Position.x, part.Position.y + part.Size.y/2 + 5/2, torso.Position.z)
  215. wait(1/30)
  216. end
  217.  
  218. lastTower = part
  219.  
  220. disabled[part] = nil
  221. part.Anchored = false
  222. end
  223. raisingTower = false
  224.  
  225.  
  226. -- Raise wall
  227. elseif key == "t" and state and not wall then
  228. game:GetService("Chat"):Chat(char.Head, raisechats[math.random(1,#raisechats)], Enum.ChatColor.Red)
  229. wall = true
  230. lastWall = nil
  231. if torso.Position.y - 5/2 < 20.4 then
  232. local part = createEarth(workspace)
  233. part.Anchored = true
  234. disabled[part] = true
  235.  
  236. for i = 0, 1, 20 do
  237. part.Size = Vector3.new(25, 15, 25)
  238. part.CFrame = CFrame.new(torso.Position.x, 0.4 + part.Size.y/2, torso.Position.z)
  239. torso.CFrame = (torso.CFrame - torso.CFrame.p) + Vector3.new(torso.Position.x, part.Position.y + part.Size.y/2 + 5/2, torso.Position.z)
  240. wait(1/30)
  241. end
  242.  
  243. lastWall = part
  244.  
  245. disabled[part] = nil
  246. part.Anchored = false
  247. end
  248. wall = false
  249.  
  250. -- Ground attack
  251. elseif key == "g" and state and not groundAttack then
  252. game:GetService("Chat"):Chat(char.Head, Taunts[math.random(1,#Taunts)], Enum.ChatColor.Red)
  253. groundAttack = true
  254. delay(1, function()
  255. groundAttack = false
  256. end)
  257.  
  258. local dir = planeY(mouse.Hit.p - torso.Position).unit
  259. local pos = planeY(torso.Position, 0.4 + 1) + dir*5
  260.  
  261. local ground = {}
  262.  
  263. delay(5, function()
  264. for i = 1, 20 do
  265. for _, part in pairs(ground) do
  266. if part.Anchored then
  267. part.CFrame = part.CFrame + Vector3.new(0, -1/7, 0)
  268. end
  269. end
  270. wait(1/30)
  271. end
  272. for _, part in pairs(ground) do
  273. if part.Anchored then
  274. part:Destroy()
  275. end
  276. end
  277. end)
  278.  
  279. for i = 1, 10 do
  280. local hit, pos2 = rayCast(pos, dir*5, {char})
  281.  
  282. local part = createEarth(workspace)
  283. part.Anchored = true
  284. part.Size = Vector3.new(4, 4, 4)
  285. part.CFrame = CFrame.new(pos2, pos2 + dir) * CFrame.Angles(math.rad(-50), 0, 0) + Vector3.new(0, -0, 0)
  286.  
  287. ground[#ground + 1] = part
  288.  
  289. -- Add force
  290. if hit then
  291. local mass = hit:GetMass()
  292.  
  293. -- Hit player
  294. for _, oPlayer in pairs(game.Players:GetPlayers()) do
  295. if oPlayer.Character and oPlayer.Character:FindFirstChild("Torso") and hit:IsDescendantOf(oPlayer.Character) then
  296. hit = oPlayer.Character.Torso
  297. mass = 20
  298. end
  299. end
  300.  
  301. if hit.Name ~= "Torso" then
  302. hit:ClearAllChildren()
  303. end
  304. hit.Anchored = false
  305.  
  306. -- Add force
  307. local bodyForce = createBody("Force", hit)
  308. bodyForce.force = (dir + Vector3.new(0, 0.2, 0)).unit*1e4 * mass
  309.  
  310. game.Debris:AddItem(bodyForce, 1/30)
  311. break
  312. end
  313.  
  314. pos = pos2
  315. wait(1/20)
  316. end
  317. end
  318. end
  319.  
  320. --- CORE CODE BELOW --- CORE CODE BELOW --- CORE CODE BELOW ---
  321. --- CORE CODE BELOW --- CORE CODE BELOW --- CORE CODE BELOW ---
  322. --- CORE CODE BELOW --- CORE CODE BELOW --- CORE CODE BELOW ---
  323.  
  324. -- Clear old tool
  325. player.Backpack:ClearAllChildren()
  326.  
  327. -- Create tool
  328. local tool = Instance.new("HopperBin")
  329. tool.Parent = player.Backpack
  330. tool.Name = "Iron's earth powers"
  331.  
  332. -- Tool selected
  333. tool.Selected:connect(function(mouse)
  334. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  335.  
  336. -- Mouse events
  337. mouse.Button1Down:connect(function()
  338. mouseDown = true
  339. end)
  340. mouse.Button1Up:connect(function()
  341. mouseDown = false
  342. end)
  343. mouse.KeyDown:connect(function(key)
  344. keysDown[key:lower()] = true
  345. onKeyChange(mouse, key:lower(), true)
  346. end)
  347. mouse.KeyUp:connect(function(key)
  348. keysDown[key:lower()] = false
  349. onKeyChange(mouse, key:lower(), false)
  350. end)
  351.  
  352. -- Call main
  353. main(mouse)
  354. end)
  355.  
  356. --- LIBRARY BELOW --- LIBRARY BELOW --- LIBRARY BELOW ---
  357. --- LIBRARY BELOW --- LIBRARY BELOW --- LIBRARY BELOW ---
  358. --- LIBRARY BELOW --- LIBRARY BELOW --- LIBRARY BELOW ---
  359.  
  360. -- Ray cast
  361. function rayCast(pos, dir, ignore)
  362. return workspace:FindPartOnRayWithIgnoreList(Ray.new(pos, dir), ignore)
  363. end
  364.  
  365. -- Create body
  366. function createBody(type, path)
  367. local body = Instance.new("Body" .. type)
  368. if type == "Gyro" then
  369. body.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  370. elseif type ~= "Force" then
  371. body.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  372. end
  373. body.Parent = path
  374. return body
  375. end
  376.  
  377. -- Get parts in region 3
  378. function getPartsInRegion3(region, parts)
  379. repeat
  380. local regParts = workspace:FindPartsInRegion3WithIgnoreList(region, parts, 100)
  381. for i, part in pairs(regParts) do
  382. parts[#parts + 1] = part
  383. end
  384. until #regParts < 100
  385. end
  386.  
  387. -- Random
  388. function r(min, max)
  389. return math.random()*(max - min) + min
  390. end
  391.  
  392. -- Plane y
  393. function planeY(v, y)
  394. return Vector3.new(v.x, y or 0, v.z)
  395. end
  396.  
  397. -- Create earth
  398. function createEarth(path)
  399. local part = createPart("Earth", path)
  400. part.BrickColor = BrickColor.new("Earth orange")
  401. part.Material = "Slate"
  402. m = Instance.new("Fire",part)
  403. m.Heat = 10
  404. part.Parent = path
  405. return part
  406. end
  407.  
  408. -- Create part
  409. function createPart(name, path)
  410. local part = Instance.new("Part")
  411. part.FormFactor = "Symmetric"
  412. part.BottomSurface = "Smooth"
  413. part.TopSurface = "Smooth"
  414. part.Size = Vector3.new(1, 1, 1)
  415. part.Name = name
  416. part.Parent = path
  417. return part
  418. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement