Advertisement
PiterMosskva_TV

aaadeadsherrifidk

Feb 4th, 2019
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.59 KB | None | 0 0
  1. -- This script has been converted to FE by iPxter
  2.  
  3.  
  4. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  5. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  6. do
  7. print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
  8. script.Parent = Player.Character
  9.  
  10. --RemoteEvent for communicating
  11. local Event = Instance.new("RemoteEvent")
  12. Event.Name = "UserInput_Event"
  13.  
  14. --Fake event to make stuff like Mouse.KeyDown work
  15. local function fakeEvent()
  16. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  17. t.connect = t.Connect
  18. return t
  19. end
  20.  
  21. --Creating fake input objects with fake variables
  22. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  23. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  24. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  25. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  26. end}
  27. --Merged 2 functions into one by checking amount of arguments
  28. CAS.UnbindAction = CAS.BindAction
  29.  
  30. --This function will trigger the events that have been :Connect()'ed
  31. local function te(self,ev,...)
  32. local t = m[ev]
  33. if t and t._fakeEvent and t.Function then
  34. t.Function(...)
  35. end
  36. end
  37. m.TrigEvent = te
  38. UIS.TrigEvent = te
  39.  
  40. Event.OnServerEvent:Connect(function(plr,io)
  41. if plr~=Player then return end
  42. if io.isMouse then
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. else
  46. local b = io.UserInputState == Enum.UserInputState.Begin
  47. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  48. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  49. end
  50. for _,t in pairs(CAS.Actions) do
  51. for _,k in pairs(t.Keys) do
  52. if k==io.KeyCode then
  53. t.Function(t.Name,io.UserInputState,io)
  54. end
  55. end
  56. end
  57. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  58. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  59. end
  60. end)
  61. Event.Parent = NLS([==[
  62. local Player = game:GetService("Players").LocalPlayer
  63. local Event = script:WaitForChild("UserInput_Event")
  64.  
  65. local UIS = game:GetService("UserInputService")
  66. local input = function(io,a)
  67. if a then return end
  68. --Since InputObject is a client-side instance, we create and pass table instead
  69. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  70. end
  71. UIS.InputBegan:Connect(input)
  72. UIS.InputEnded:Connect(input)
  73.  
  74. local Mouse = Player:GetMouse()
  75. local h,t
  76. --Give the server mouse data 30 times every second, but only if the values changed
  77. --If player is not moving their mouse, client won't fire events
  78. while wait(1/30) do
  79. if h~=Mouse.Hit or t~=Mouse.Target then
  80. h,t=Mouse.Hit,Mouse.Target
  81. Event:FireServer({isMouse=true,Target=t,Hit=h})
  82. end
  83. end]==],Player.Character)
  84. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  85. end
  86.  
  87. -- Player declarations
  88. local player = owner
  89. local char = player.Character
  90.  
  91. -- Body parts
  92. local torso = char.Torso
  93.  
  94. -- Tool declarations
  95. local mouseDown = false
  96. local keysDown = {}
  97.  
  98. -- Earth bending declarations
  99. local raisingEarth = false
  100. local raisingTower = false
  101. local wall = false
  102. local groundAttack = false
  103. local lastTower = nil
  104. local disabled = {}
  105. local frames = {}
  106. local parts = {}
  107. 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!"}
  108. 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."}
  109.  
  110. -- Main
  111. function main(mouse)
  112. while true do wait(1/30)
  113. local look = CFrame.new(torso.Position, torso.Position + mouse.Hit.lookVector)
  114.  
  115. -- Reset parts
  116. parts = {}
  117.  
  118. -- Get parts
  119. for x = -20, 20, 10 do
  120. for y = -20, 20, 10 do
  121. for z = -30, -10, 10 do
  122. local pos = look * Vector3.new(x, y, z)
  123. getPartsInRegion3(
  124. Region3.new(
  125. pos + Vector3.new(1,1,1)*-9,
  126. pos + Vector3.new(1,1,1)* 9
  127. ),
  128. parts
  129. )
  130. end
  131. end
  132. end
  133.  
  134. -- Mouse down
  135. if mouseDown then
  136. -- Create dif and bodies
  137. for _, part in pairs(parts) do
  138. if part.Name == "Earth" and not disabled[part] then
  139. if not frames[part] and part ~= lastTower then
  140. frames[part] = look:toObjectSpace(part.CFrame)
  141.  
  142. part:ClearAllChildren()
  143. part.Anchored = false
  144.  
  145. -- Create bodies
  146. createBody("Position", part)
  147. createBody("Gyro", part)
  148. end
  149. end
  150. end
  151.  
  152. -- Move bodies
  153. for part in pairs(frames) do
  154. local bodyPos = part:FindFirstChild("BodyPosition")
  155. local bodyGyr = part:FindFirstChild("BodyGyro")
  156.  
  157. -- Bodies exist
  158. if bodyPos and bodyGyr then
  159. local dif = look * frames[part]
  160.  
  161. bodyPos.position = dif.p
  162. bodyGyr.cframe = dif
  163. else
  164. frames[part] = nil
  165. end
  166. end
  167. else
  168. for part in pairs(frames) do
  169. if part.Name == "Earth" then
  170. frames[part] = nil
  171.  
  172. part:ClearAllChildren()
  173. end
  174. end
  175. end
  176. end
  177. end
  178.  
  179. -- On key change
  180. function onKeyChange(mouse, key, state)
  181. -- Raise earth
  182. if key == "e" and state and not raisingEarth then
  183. game:GetService("Chat"):Chat(char.Head, raisechats[math.random(1,#raisechats)], Enum.ChatColor.Red)
  184. raisingEarth = true
  185. while keysDown[key] do
  186. local torsoY = torso.Position.y + 3
  187. local pos = planeY(torso.Position, 0.4 - 4/2)
  188. local dir = planeY(mouse.Hit.lookVector).unit
  189. local frame = CFrame.new(pos, pos + dir) * CFrame.new(r(-10, 10), 0, r(-20, -5))
  190.  
  191. -- Create earth part
  192. local part = createEarth(workspace)
  193. part.Anchored = true
  194. part.Size = Vector3.new(4, 4, 4)
  195. disabled[part] = true
  196.  
  197. -- Raise earth
  198. for i = 1, 4 do i = i/4
  199. part.CFrame = frame * CFrame.new(0, (torsoY - frame.y)*i, 0)
  200. wait(1/10000000)
  201. if not part.Anchored then
  202. break
  203. end
  204. end
  205.  
  206. disabled[part] = nil
  207. part.Anchored = false
  208.  
  209. wait(1/100)
  210. end
  211. raisingEarth = false
  212.  
  213.  
  214.  
  215.  
  216.  
  217. elseif key == "c" and state and not raisingEarth then
  218. game:GetService("Chat"):Chat(char.Head, raisechats[math.random(1,#raisechats)], Enum.ChatColor.Red)
  219. raisingEarth = true
  220. while keysDown[key] do
  221. local torsoY = torso.Position.y + 3
  222. local pos = planeY(torso.Position, 0.4 - 4/2)
  223. local dir = planeY(mouse.Hit.lookVector).unit
  224. local frame = CFrame.new(pos, pos + dir) * CFrame.new(r(-10, 10), 0, r(-20, -5))
  225.  
  226. -- Create earth part
  227. local part = createEarth(workspace)
  228. part.Anchored = true
  229. part.Size = Vector3.new(2, 2, 2)
  230. disabled[part] = true
  231.  
  232. -- Raise earth
  233. for i = 1, 4 do i = i/4
  234. part.CFrame = frame * CFrame.new(0, (torsoY - frame.y)*i, 0)
  235. wait(1/10000000)
  236. if not part.Anchored then
  237. break
  238. end
  239. end
  240.  
  241. disabled[part] = nil
  242. part.Anchored = false
  243.  
  244. wait(1/100)
  245. end
  246. raisingEarth = false
  247.  
  248.  
  249.  
  250. -- Push earth
  251. elseif key == "f" and state then
  252. game:GetService("Chat"):Chat(char.Head, Taunts[math.random(1,#Taunts)], Enum.ChatColor.Red)
  253. for _, part in pairs(parts) do
  254. if part.Name == "Earth" and part ~= lastTower then
  255. part:ClearAllChildren()
  256. part.Anchored = false
  257.  
  258. -- Add force
  259. local bodyForce = createBody("Force", part)
  260. bodyForce.force = mouse.Hit.lookVector*1.5e4 * part:GetMass()
  261.  
  262. game.Debris:AddItem(bodyForce, 1/30)
  263.  
  264. -- Disable part
  265. disabled[part] = true
  266. delay(1, function()
  267. disabled[part] = nil
  268. end)
  269. end
  270. end
  271.  
  272. -- Monster Ability
  273. elseif key == "m" and state then
  274. wait(.1)
  275. f = Instance.new("Fire")
  276. f.Parent = char.Head
  277. f.Color = Color3.new(0.7,0.5,0.9)
  278. f.Size = 5
  279. f.Heat = 5
  280. wait(.1)
  281. g = Instance.new("Fire")
  282. g.Parent = char["Right Arm"]
  283. g.Color = Color3.new(0.7,0.5,0.9)
  284. g.Size = 5
  285. g.Heat = 5
  286. wait(.1)
  287. h = Instance.new("Fire")
  288. h.Parent = char["Left Arm"]
  289. h.Color = Color3.new(0.7,0.5,0.9)
  290. h.Size = 5
  291. h.Heat = 5
  292. wait(.1)
  293. z = Instance.new("Sound")
  294. z.Parent = game.Workspace
  295. z.SoundId = "http://www.roblox.com/asset/?id=159365911"
  296. z.Looped = false
  297. z.Volume = 1
  298. z.Pitch = 0.65
  299. wait(1.8)
  300. game:GetService("Chat"):Chat(char.Head, "Hmph.", Enum.ChatColor.Red)
  301. wait(3.4)
  302. game:GetService("Chat"):Chat(char.Head, "This has become a pointless battle.", Enum.ChatColor.Red)
  303. wait(2.4)
  304. game:GetService("Chat"):Chat(char.Head, "I will end this quickly", Enum.ChatColor.Red)
  305. wait(.1)
  306. z:Play()
  307. char.Humanoid.MaxHealth = 900000000
  308. wait(1)
  309. char.Humanoid.Health = 900000000
  310. wait(182)
  311. char.Humanoid.MaxHealth = 600
  312. z:Remove()
  313. f:Remove()
  314. g:Remove()
  315. h:Remove()
  316.  
  317. -- N-Rage
  318. elseif key == "n" and state then
  319. c = Instance.new("Sound")
  320. c.Parent = game.Workspace
  321. c.SoundId = "http://www.roblox.com/asset/?id=157747165"
  322. c.Looped = false
  323. c.Volume = 1
  324. c.Pitch = .7
  325. wait(1.8)
  326. game:GetService("Chat"):Chat(char.Head, "What the hell was that?", Enum.ChatColor.Red)
  327. wait(2)
  328. game:GetService("Chat"):Chat(char.Head, "Did you actually believe you could harm me?", Enum.ChatColor.Red)
  329. wait(2.4)
  330. 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)
  331. wait(3.5)
  332. game:GetService("Chat"):Chat(char.Head, "All you have done is waste my time.", Enum.ChatColor.Red)
  333. wait(.1)
  334. c:Play()
  335. char.Humanoid.MaxHealth = math.huge
  336. wait(160)
  337. char.Humanoid.MaxHealth = 10000
  338. c:Remove()
  339.  
  340. -- Break earth
  341. elseif key == "b" and state then
  342. game:GetService("Chat"):Char(char.Head, "Hmph.", Enum.ChatColor.Red)
  343. wait(.01)
  344. for part in pairs(frames) do
  345. if part.Size == Vector3.new(4, 4, 4) then
  346. for x = -1, 2, 2 do
  347. for y = -1, 2, 2 do
  348. for z = -1, 1, 2 do
  349. local oPart = createEarth(workspace)
  350. oPart.Size = Vector3.new(2, 2, 2)
  351. oPart.CFrame = part.CFrame * CFrame.new(x*1.1, y*1.1, z*1.1)
  352. end
  353. end
  354. end
  355. part:Destroy()
  356. end
  357.  
  358. end
  359.  
  360. for part in pairs(frames) do
  361. if part.Size == Vector3.new(25, 15, 25) then
  362. for x = -3, 2, 2 do
  363. for y = -3, 2, 2 do
  364. for z = -3, 1, 2 do
  365. local oPart = createEarth(workspace)
  366. oPart.Size = Vector3.new(2, 2, 2)
  367. oPart.CFrame = part.CFrame * CFrame.new(x*1.1, y*1.1, z*1.1)
  368. end
  369. end
  370. end
  371. part:Destroy()
  372. end
  373.  
  374. end
  375.  
  376. for part in pairs(frames) do
  377. if part.Size == Vector3.new(2, 2, 2) then
  378. for x = -0.5, 2, 2 do
  379. for y = -0.5, 2, 2 do
  380. for z = -0.5, 1, 2 do
  381. local oPart = createEarth(workspace)
  382. oPart.Size = Vector3.new(1, 1, 1)
  383. oPart.CFrame = part.CFrame * CFrame.new(x*1.1, y*1.1, z*1.1)
  384. end
  385. end
  386. end
  387. part:Destroy()
  388. end
  389.  
  390. end
  391.  
  392.  
  393.  
  394.  
  395. -- Raise tower
  396. elseif key == "r" and state and not raisingTower then
  397. game:GetService("Chat"):Chat(char.Head, raisechats[math.random(1,#raisechats)], Enum.ChatColor.Red)
  398. raisingTower = true
  399. lastTower = nil
  400. if torso.Position.y - 5/2 < 20.4 then
  401. local part = createEarth(workspace)
  402. part.Anchored = true
  403. disabled[part] = true
  404.  
  405. for i = 0, 20, 4 do
  406. part.Size = Vector3.new(5, i, 5)
  407. part.CFrame = CFrame.new(torso.Position.x, 0.4 + part.Size.y/2, torso.Position.z)
  408. torso.CFrame = (torso.CFrame - torso.CFrame.p) + Vector3.new(torso.Position.x, part.Position.y + part.Size.y/2 + 5/2, torso.Position.z)
  409. wait(1/30)
  410. end
  411.  
  412. lastTower = part
  413.  
  414. disabled[part] = nil
  415. part.Anchored = false
  416. end
  417. raisingTower = false
  418.  
  419.  
  420. -- Raise wall
  421. elseif key == "t" and state and not wall then
  422. game:GetService("Chat"):Chat(char.Head, raisechats[math.random(1,#raisechats)], Enum.ChatColor.Red)
  423. wall = true
  424. lastWall = nil
  425. if torso.Position.y - 5/2 < 20.4 then
  426. local part = createEarth(workspace)
  427. part.Anchored = true
  428. disabled[part] = true
  429.  
  430. for i = 0, 1, 20 do
  431. part.Size = Vector3.new(25, 15, 25)
  432. part.CFrame = CFrame.new(torso.Position.x, 0.4 + part.Size.y/2, torso.Position.z)
  433. torso.CFrame = (torso.CFrame - torso.CFrame.p) + Vector3.new(torso.Position.x, part.Position.y + part.Size.y/2 + 5/2, torso.Position.z)
  434. wait(1/30)
  435. end
  436.  
  437. lastWall = part
  438.  
  439. disabled[part] = nil
  440. part.Anchored = false
  441. end
  442. wall = false
  443.  
  444. -- Ground attack
  445. elseif key == "g" and state and not groundAttack then
  446. game:GetService("Chat"):Chat(char.Head, Taunts[math.random(1,#Taunts)], Enum.ChatColor.Red)
  447. groundAttack = true
  448. delay(1, function()
  449. groundAttack = false
  450. end)
  451.  
  452. local dir = planeY(mouse.Hit.p - torso.Position).unit
  453. local pos = planeY(torso.Position, 0.4 + 1) + dir*5
  454.  
  455. local ground = {}
  456.  
  457. delay(5, function()
  458. for i = 1, 20 do
  459. for _, part in pairs(ground) do
  460. if part.Anchored then
  461. part.CFrame = part.CFrame + Vector3.new(0, -1/7, 0)
  462. end
  463. end
  464. wait(1/30)
  465. end
  466. for _, part in pairs(ground) do
  467. if part.Anchored then
  468. part:Destroy()
  469. end
  470. end
  471. end)
  472.  
  473. for i = 1, 10 do
  474. local hit, pos2 = rayCast(pos, dir*5, {char})
  475.  
  476. local part = createEarth(workspace)
  477. part.Anchored = true
  478. part.Size = Vector3.new(4, 4, 4)
  479. part.CFrame = CFrame.new(pos2, pos2 + dir) * CFrame.Angles(math.rad(-50), 0, 0) + Vector3.new(0, -0, 0)
  480.  
  481. ground[#ground + 1] = part
  482.  
  483. -- Add force
  484. if hit then
  485. local mass = hit:GetMass()
  486.  
  487. -- Hit player
  488. for _, oPlayer in pairs(game.Players:GetPlayers()) do
  489. if oPlayer.Character and oPlayer.Character:FindFirstChild("Torso") and hit:IsDescendantOf(oPlayer.Character) then
  490. hit = oPlayer.Character.Torso
  491. mass = 20
  492. end
  493. end
  494.  
  495. if hit.Name ~= "Torso" then
  496. hit:ClearAllChildren()
  497. end
  498. hit.Anchored = false
  499.  
  500. -- Add force
  501. local bodyForce = createBody("Force", hit)
  502. bodyForce.force = (dir + Vector3.new(0, 0.2, 0)).unit*1e4 * mass
  503.  
  504. game.Debris:AddItem(bodyForce, 1/30)
  505. break
  506. end
  507.  
  508. pos = pos2
  509. wait(1/20)
  510. end
  511. end
  512. end
  513.  
  514. --- CORE CODE BELOW --- CORE CODE BELOW --- CORE CODE BELOW ---
  515. --- CORE CODE BELOW --- CORE CODE BELOW --- CORE CODE BELOW ---
  516. --- CORE CODE BELOW --- CORE CODE BELOW --- CORE CODE BELOW ---
  517.  
  518. -- Clear old tool
  519. player.Backpack:ClearAllChildren()
  520.  
  521. -- Create tool
  522. local tool = Instance.new("HopperBin")
  523. tool.Parent = player.Backpack
  524. tool.Name = "Kronola's Custom"
  525.  
  526. -- Tool selected
  527. tool.Selected:connect(function(mouse)
  528. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  529.  
  530. -- Mouse events
  531. mouse.Button1Down:connect(function()
  532. mouseDown = true
  533. end)
  534. mouse.Button1Up:connect(function()
  535. mouseDown = false
  536. end)
  537. mouse.KeyDown:connect(function(key)
  538. keysDown[key:lower()] = true
  539. onKeyChange(mouse, key:lower(), true)
  540. end)
  541. mouse.KeyUp:connect(function(key)
  542. keysDown[key:lower()] = false
  543. onKeyChange(mouse, key:lower(), false)
  544. end)
  545.  
  546. -- Call main
  547. main(mouse)
  548. end)
  549.  
  550. --- LIBRARY BELOW --- LIBRARY BELOW --- LIBRARY BELOW ---
  551. --- LIBRARY BELOW --- LIBRARY BELOW --- LIBRARY BELOW ---
  552. --- LIBRARY BELOW --- LIBRARY BELOW --- LIBRARY BELOW ---
  553.  
  554. -- Ray cast
  555. function rayCast(pos, dir, ignore)
  556. return workspace:FindPartOnRayWithIgnoreList(Ray.new(pos, dir), ignore)
  557. end
  558.  
  559. -- Create body
  560. function createBody(type, path)
  561. local body = Instance.new("Body" .. type)
  562. if type == "Gyro" then
  563. body.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  564. elseif type ~= "Force" then
  565. body.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  566. end
  567. body.Parent = path
  568. return body
  569. end
  570.  
  571. -- Get parts in region 3
  572. function getPartsInRegion3(region, parts)
  573. repeat
  574. local regParts = workspace:FindPartsInRegion3WithIgnoreList(region, parts, 100)
  575. for i, part in pairs(regParts) do
  576. parts[#parts + 1] = part
  577. end
  578. until #regParts < 100
  579. end
  580.  
  581. -- Random
  582. function r(min, max)
  583. return math.random()*(max - min) + min
  584. end
  585.  
  586. -- Plane y
  587. function planeY(v, y)
  588. return Vector3.new(v.x, y or 0, v.z)
  589. end
  590.  
  591. -- Create earth
  592. function createEarth(path)
  593. local part = createPart("Earth", path)
  594. part.BrickColor = BrickColor.new("Really black")
  595. part.Material = "Slate"
  596. m = Instance.new("Fire",part)
  597. m.Heat = 10
  598. part.Parent = path
  599. return part
  600. end
  601.  
  602. -- Create part
  603. function createPart(name, path)
  604. local part = Instance.new("Part")
  605. part.FormFactor = "Symmetric"
  606. part.BottomSurface = "Smooth"
  607. part.TopSurface = "Smooth"
  608. part.Size = Vector3.new(1, 1, 1)
  609. part.Name = name
  610. part.Parent = path
  611. return part
  612. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement