Advertisement
GForcebit

AVATAR Script

Apr 7th, 2018
697
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 44.85 KB | None | 0 0
  1. --Edited by GForcebit/GForcebot--
  2. --Made by https://pastebin.com/u/NextFlamePB"
  3. local player = game.Players.LocalPlayer
  4. local char = player.Character
  5. -- Body parts
  6. local torso = char.Torso
  7. -- Tool declarations
  8. local mouseDown = false
  9. local keysDown = {}
  10. local raisingAir = false
  11. local raisingTower = false
  12. local ra1singTower = false
  13. local groundAttack = false
  14. local Lightbendd = false
  15. local AvatarField = false
  16. local lastTower = nil
  17. local raisingTow3r = false
  18. local disabled = {}
  19. local frames = {}
  20. local parts = {}
  21. -- Main
  22. function main(mouse)
  23. while true do wait(1/30)
  24. local look = CFrame.new(torso.Position, torso.Position + mouse.Hit.lookVector)
  25.  
  26. -- Reset parts
  27. parts = {}
  28.  
  29. -- Get parts
  30. for x = -20, 20, 10 do
  31. for y = -20, 20, 10 do
  32. for z = -30, -10, 10 do
  33. local pos = look * Vector3.new(x, y, z)
  34. getPartsInRegion3(
  35. Region3.new(
  36. pos + Vector3.new(1,1,1)*-9,
  37. pos + Vector3.new(1,1,1)* 9
  38. ),
  39. parts
  40. )
  41. end
  42. end
  43. end
  44.  
  45. -- Mouse down
  46. if mouseDown then
  47. -- Create dif and bodies
  48. for _, part in pairs(parts) do
  49. if part.Name == "Air" and not disabled[part] then
  50. if not frames[part] and part ~= lastTower then
  51. frames[part] = look:toObjectSpace(part.CFrame)
  52.  
  53. part:ClearAllChildren()
  54. part.Anchored = false
  55.  
  56. -- Create bodies
  57. createBody("Position", part)
  58. createBody("Gyro", part)
  59. end
  60. end
  61. end
  62.  
  63. -- Move bodies
  64. for part in pairs(frames) do
  65. local bodyPos = part:FindFirstChild("BodyPosition")
  66. local bodyGyr = part:FindFirstChild("BodyGyro")
  67.  
  68. -- Bodies exist
  69. if bodyPos and bodyGyr then
  70. local dif = look * frames[part]
  71.  
  72. bodyPos.position = dif.p
  73. bodyGyr.cframe = dif
  74. else
  75. frames[part] = nil
  76. end
  77. end
  78. else
  79. for part in pairs(frames) do
  80. if part.Name == "Air" then
  81. frames[part] = nil
  82.  
  83. part:ClearAllChildren()
  84. end
  85. end
  86. end
  87. end
  88. end
  89. -- On key change
  90. function onKeyChange(mouse, key, state)
  91. -- Raise Air
  92. if key == "e" and state and not raisingAir then
  93. raisingAir = true
  94. while keysDown[key] do
  95. local torsoY = torso.Position.y + 5
  96. local pos = planeY(torso.Position, 0.4 - 4/2)
  97. local dir = planeY(mouse.Hit.lookVector).unit
  98. local frame = CFrame.new(pos, pos + dir) * CFrame.new(r(-10, 10), 0, r(-20, -5))
  99.  
  100. -- Create Air part
  101. local part = createAir(workspace)
  102. part.Anchored = true
  103. part.Size = Vector3.new(20, 5, 5)
  104. disabled[part] = true
  105.  
  106. -- Raise Air
  107. for i = 1, 4 do i = i/4
  108. part.CFrame = frame * CFrame.new(0, (torsoY - frame.y)*i, 0)
  109. wait(1/30)
  110. if not part.Anchored then
  111. break
  112. end
  113. end
  114.  
  115. disabled[part] = nil
  116. part.Anchored = false
  117.  
  118. wait(1/10)
  119. end
  120. raisingAir = false
  121.  
  122. -- Push Air
  123. elseif key == "f" and state then
  124. for _, part in pairs(parts) do
  125. if part.Name == "Air" and part ~= lastTower then
  126. part:ClearAllChildren()
  127. part.Anchored = false
  128.  
  129. -- Add force
  130. local bodyForce = createBody("Force", part)
  131. bodyForce.force = mouse.Hit.lookVector*2.5e4 * part:GetMass()
  132.  
  133. game.Debris:AddItem(bodyForce, 1/30)
  134.  
  135. -- Disable part
  136. disabled[part] = true
  137. delay(1, function()
  138. disabled[part] = nil
  139. end)
  140. end
  141. end
  142. if key == "c" and state and not Lightbendd then
  143. Lightbendd = true
  144. local Shoot = true
  145. function Click(Target)
  146. if(Target.Target.Parent:findFirstChild("Humanoid")~=nil)then
  147. Target.Target.Parent.Humanoid.Health = 0
  148. end
  149. local P = Instance.new("Part")
  150. P.Name = "Lightning Bending"
  151. local Place0 = script.Parent.Parent.Parent.Character["Left Arm"].CFrame
  152. P.formFactor = 0
  153. P.Size = Vector3.new(1,1,(Place0.p - Target.Hit.p).magnitude)
  154. P.CFrame = CFrame.new((Place0.p + Target.Hit.p)/2,Place0.p)
  155. P.Parent = game.Workspace
  156. P.Color = Color3.new(0,0,7)
  157. P.Transparency = 0.5
  158. P.Reflectance = 0.5
  159. P.Anchored = true
  160. P.CanCollide = false
  161. local E = Instance.new("Explosion")
  162. E.Position = Target.Hit.p
  163. E.Parent = game.Workspace
  164. for i = 1,10 do
  165. P.Transparency = 0.5+(i*0.05)
  166. P.Reflectance = i*0.05
  167. wait(0.0)
  168. end
  169. P:Rremove()
  170. end
  171. function Select(Mouse)
  172. local Arm = script.Parent.Parent.Parent.Character:findFirstChild("Left Arm")
  173. if(Arm==nil)then
  174. script.Parent:Remove()
  175. script:Remove()
  176. end
  177. Selected = true
  178. local Torso = script.Parent.Parent.Parent.Character:findFirstChild("Torso")
  179. if(Torso==nil)then
  180. script.Parent:Remove()
  181. script:Remove()
  182. end
  183. local ArmWeld = Torso:findFirstChild("Left Shoulder")
  184. if(ArmWeld~=nil)then
  185. ArmWeld.Parent = nil
  186. end
  187. Mouse.Button1Down:connect(function()Click(Mouse)end)
  188. Arm.Anchored = true
  189. while Selected do
  190. local Place0 = script.Parent.Parent.Parent.Character.Torso.CFrame
  191. Place0 = Place0 + ((Place0 * CFrame.fromEulerAnglesXYZ(math.pi/2,0,0)).lookVector * 0.5) + (Place0 * CFrame.fromEulerAnglesXYZ(0,math.pi/2,0)).lookVector
  192. local Place1 = Place0 + ((Place0.p-Mouse.Hit.p).unit * -2)
  193. Arm.CFrame = CFrame.new((Place0.p + Place1.p)/2,Place0.p) * CFrame.fromEulerAnglesXYZ(-math.pi/2,0,0)
  194. wait()
  195. end
  196. Arm.Anchored = false
  197. if(ArmWeld~=nil)then
  198. ArmWeld.Parent = Torso
  199. end
  200. end
  201. function Deselect()
  202. Selected = false
  203. end
  204. script.Parent.Selected:connect(Select)
  205. script.Parent.Deselected:connect(Deselect)
  206. end
  207.  
  208. elseif key == "k" and state and not ra1singTower then
  209. ra1singTower = false
  210. lastTower = nil
  211. if torso.Position.y - 5/2 < 20.4 then
  212. local part = createAir(workspace)
  213. part.Anchored = true
  214. disabled[part] = true
  215.  
  216. for i = 100, 50, 1 do
  217. part.Size = Vector3.new(19, i, 10)
  218. part.CFrame = CFrame.new(torso.Position.x, 0.4 + part.Size.y/2, torso.Position.z)
  219. torso.CFrame = (torso.CFrame - torso.CFrame.p) + Vector3.new(torso.Position.x, part.Position.y + part.Size.y/2 + 5/2, torso.Position.z)
  220. wait(1/30)
  221. end
  222.  
  223. lastTower = part
  224.  
  225. disabled[part] = nil
  226. part.Anchored = false
  227. end
  228. ra1singTower = false
  229.  
  230. -- Avatar field
  231. elseif key == "h" and state and not AvatarField then
  232. AvatarField = true
  233. local player = game.Players.LocalPlayer
  234. local e = Instance.new("Part")
  235. e.Name = "Field"
  236. e.Anchored = true
  237. e.CanCollide = false
  238. e.FormFactor = "Symmetric"
  239. local range = 30
  240. e.Size = Vector3.new(range,1,range)
  241. e.BrickColor = BrickColor.new("Bright blue")
  242. e.Transparency = 0.5
  243. e.TopSurface, e.BottomSurface = "Smooth", "Smooth"
  244. Instance.new("CylinderMesh", e)
  245. local eRep = e:clone()
  246. local E = e:clone()
  247. E.Transparency = 1
  248. E.Shape = "Ball"
  249. E.Size = Vector3.new(10,10,10)
  250. E.Mesh:Destroy()
  251. E.Parent = e
  252. local E2 = E:clone()
  253. E2.Transparency = 1
  254. E2.Size = Vector3.new(range,range,range)
  255. local E2Rep = E2:clone()
  256. E2.Parent = E
  257. local ERep = E:clone()
  258. local close1, dist1 = Vector3.new(0,0,0), math.huge
  259. local df = Instance.new("IntValue", player.Character)
  260. df.Name = "Avatar State"
  261. function Get(place, p)
  262. for _, v in ipairs(place:GetChildren()) do
  263. local vPar = v.Parent
  264. if v:IsA("BasePart") and v.Name ~= "Base" and v.Name ~= "Terrain" and not v.Name:find(player.Name) and v.Name ~= "NoDestroy" then
  265. local dist = (v.Position - e.Position).magnitude
  266. local closest = dist
  267. local distf = ((v.Position + (v.CFrame*CFrame.Angles(0,math.deg(0),0).lookVector) * v.Size.X/2) - e.Position).magnitude
  268. local distb = ((v.Position + (v.CFrame*CFrame.Angles(0,math.deg(180),0)).lookVector * v.Size.Z/2) - e.Position).magnitude
  269. local distt = ((v.Position + (v.CFrame*CFrame.Angles(math.deg(90),0,0)).lookVector * v.Size.Y/2) - e.Position).magnitude
  270. local distB = ((v.Position + (v.CFrame*CFrame.Angles(math.deg(-90),0,0)).lookVector * v.Size.Y/2) - e.Position).magnitude
  271. local distl = ((v.Position + (v.CFrame*CFrame.Angles(0,math.deg(90),0)).lookVector * v.Size.X/2) - e.Position).magnitude
  272. local distr = ((v.Position + (v.CFrame*CFrame.Angles(0,math.deg(-90),0)).lookVector * v.Size.X/2) - e.Position).magnitude
  273. local dists = {distf, distb, distt, distB, distl, distr}
  274. for index, var in ipairs(dists) do
  275. if var < closest then
  276. closest = var
  277. end
  278. end
  279. if closest < dist1 then
  280. close1, dist1 = v.Position, closest
  281. end
  282. if closest <= range/2 then
  283. if game.Players:playerFromCharacter(v.Parent) then
  284. pcall(function()
  285. local p = game.Players:playerFromCharacter(v.Parent)
  286. if not p.Character:findFirstChild("Darkfield") then
  287. local T = p.Character:findFirstChild("Torso")
  288. T.CFrame = T.CFrame + CFrame.new(e.Position, T.Position).lookVector
  289. else
  290. local m = Instance.new("SpecialMesh", E2)
  291. m.MeshType = "Sphere"
  292. E2.Reflectance = 1000
  293. E2.BrickColor = BrickColor.new("Institutional white")
  294. E2.Transparency = 0
  295. m.Scale = Vector3.new(math.random(-10,10)/10, math.random(-10,10)/10, math.random(-10,10)/10)
  296. end
  297. end)
  298. end
  299. local T = player.Character.Torso
  300. pcall(function()
  301. if v.Name ~= "Field" and v.Name ~= "Handle" then
  302. v.Anchored = false
  303. v.Velocity = v.Velocity + CFrame.new(T.Position, v.Position).lookVector * 50 / math.sqrt((v.Position - T.Position).magnitude)
  304. end
  305. end)
  306. for X, Y in ipairs(v:GetChildren()) do
  307. if Y.ClassName:find("Body") then
  308. pcall(function() Y.force = -Y.force end)
  309. local vel = Vector3.new()
  310. pcall(function() vel = -Y.velocity end)
  311. pcall(function() Y.velocity = vel end)
  312. local pos = Vector3.new()
  313. pcall(function() pos = pos + CFrame.new(T.Position, v.Position).lookVector end)
  314. pcall(function() Y.position = pos end)
  315. wait()
  316. pcall(function() if Y.ClassName == "BodyVelocity" then if Y.velocity ~= vel then Y.maxForce = Vector3.new(0,0,0) end end end)
  317. pcall(function() if Y.ClassName == "BodyPosition" then if Y.position ~= pos then Y.maxForce = Vector3.new(0,0,0) end end end)
  318. pcall(function() Y.maxTorque = Vector3.new(0,0,0) end)
  319. end
  320. end
  321. end
  322. end
  323. if v.Name ~= player.Name then
  324. Get(v, game.Players:playerFromCharacter(v) or p)
  325. end
  326. end
  327. end
  328. local char = player.Character
  329. Delay(0, function()
  330. while player.Character == char do
  331. if math.random(1, 10) == 1 then
  332. for _, v in ipairs(player.Character:GetChildren()) do
  333. if v.Name == "Field" then
  334. v:Destroy()
  335. end
  336. end
  337. local trans = e.Transparency
  338. if e then
  339. e:Destroy()
  340. end
  341. e = eRep
  342. eRep = e:clone()
  343. e.Parent = player.Character
  344. if E then
  345. E:Destroy()
  346. end
  347. E = ERep
  348. ERep = E:clone()
  349. E.Parent = e
  350. E2 = E2Rep
  351. E2Rep = E2:clone()
  352. E2.Parent = E
  353. E2.Transparency = .1 + .1*math.min(math.max(dist1-range/2, 0)/(range/2), 1)
  354. end
  355. e.CFrame = player.Character.Torso.CFrame - Vector3.new(0,3,0)
  356. E.CFrame = player.Character.Torso.CFrame
  357. E2.CFrame = e.CFrame
  358. close1, dist1 = Vector3.new(0,0,0), math.huge
  359. Get(workspace)
  360. wait(1/30)
  361. E2.Transparency = .6 + .4*math.min(math.max(dist1-range/2, 0)/(range/2), 1)
  362. AvatarField = false
  363. end
  364. end)
  365. elseif key == "t" and state and not raisingTow3r then
  366. raisingTow3r = false
  367. lastTower = nil
  368. if torso.Position.y - 5/2 < 20.4 then
  369. local part = createAir(workspace)
  370. part.Anchored = true
  371. disabled[part] = true
  372.  
  373. for i = 0, 20, 4 do
  374. part.Size = Vector3.new(9, i, 9)
  375. part.CFrame = CFrame.new(torso.Position.x, 0.4 + part.Size.y/2, torso.Position.z)
  376. torso.CFrame = (torso.CFrame - torso.CFrame.p) + Vector3.new(torso.Position.x, part.Position.y + part.Size.y/2 + 5/2, torso.Position.z)
  377. wait(1/30)
  378. end
  379.  
  380. lastTower = part
  381.  
  382. disabled[part] = nil
  383. part.Anchored = false
  384. end
  385. raisingTow3r = false
  386. -- Break Air
  387. elseif key == "b" and state then
  388. for part in pairs(frames) do
  389. if part.Size == Vector3.new(4, 4, 4) then
  390. for x = -1, 1, 2 do
  391. for y = -1, 1, 2 do
  392. for z = -1, 1, 2 do
  393. local oPart = createAir(workspace)
  394. oPart.Size = Vector3.new(2, 2, 2)
  395. oPart.CFrame = part.CFrame * CFrame.new(x*1.1, y*1.1, z*1.1)
  396. end
  397. end
  398. end
  399. part:Destroy()
  400. end
  401. end
  402.  
  403.  
  404. elseif key == "r" and state and not raisingTower then
  405. raisingTower = false
  406. lastTower = nil
  407. if torso.Position.y - 5/2 < 20.4 then
  408. local part = createAir(workspace)
  409. part.Anchored = true
  410. disabled[part] = true
  411.  
  412. for i = 0, 40, 4 do
  413. part.Size = Vector3.new(5, i, 30)
  414. part.CFrame = CFrame.new(torso.Position.x, 0.4 + part.Size.y/2, torso.Position.z)
  415. torso.CFrame = (torso.CFrame - torso.CFrame.p) + Vector3.new(torso.Position.x, part.Position.y + part.Size.y/2 + 5/2, torso.Position.z)
  416. wait(1/30)
  417. end
  418.  
  419. lastTower = part
  420.  
  421. disabled[part] = nil
  422. part.Anchored = false
  423. end
  424. raisingTower = false
  425.  
  426.  
  427. -- Ground attack
  428. elseif key == "g" and state and not groundAttack then
  429. groundAttack = true
  430. delay(1, function()
  431. groundAttack = false
  432. end)
  433.  
  434. local dir = planeY(mouse.Hit.p - torso.Position).unit
  435. local pos = planeY(torso.Position, 0.8 + 5) + dir*13
  436.  
  437. local ground = {}
  438.  
  439. delay(20, function()
  440. for i = 1, 30 do
  441. for _, part in pairs(ground) do
  442. if part.Anchored then
  443. part.CFrame = part.CFrame + Vector3.new(0, -1/7, 0)
  444. end
  445. end
  446. wait(1/80)
  447. end
  448. for _, part in pairs(ground) do
  449. if part.Anchored then
  450. part:Destroy()
  451. end
  452. end
  453. end)
  454.  
  455. for i = 1, 13 do
  456. local hit, pos2 = rayCast(pos, dir*5, {char})
  457.  
  458. local part = createAir(workspace)
  459. part.Anchored = true
  460. part.Size = Vector3.new(10, 20, 10)
  461. part.CFrame = CFrame.new(pos2, pos2 + dir) * CFrame.Angles(math.rad(-50), 0, 0) + Vector3.new(0, -0, 0)
  462.  
  463. ground[#ground + 3] = part
  464.  
  465. -- Add force
  466. if hit then
  467. local mass = hit:GetMass()
  468.  
  469. -- Hit player
  470. for _, oPlayer in pairs(game.Players:GetPlayers()) do
  471. if oPlayer.Character and oPlayer.Character:FindFirstChild("Torso") and hit:IsDescendantOf(oPlayer.Character) then
  472. hit = oPlayer.Character.Torso
  473. mass = 90
  474. end
  475. end
  476.  
  477. if hit.Name ~= "Torso" then
  478. hit:ClearAllChildren()
  479. end
  480. hit.Anchored = false
  481.  
  482. -- Add force
  483. local bodyForce = createBody("Force", hit)
  484. bodyForce.force = (dir + Vector3.new(0, 0.9, 0)).unit*1e4 * mass
  485.  
  486. game.Debris:AddItem(bodyForce, 1/30)
  487. break
  488. end
  489.  
  490. pos = pos2
  491. wait(1/20)
  492. end
  493. end
  494. end
  495. --- CORE CODE BELOW --- CORE CODE BELOW --- CORE CODE BELOW ---
  496. --- CORE CODE BELOW --- CORE CODE BELOW --- CORE CODE BELOW ---
  497. --- CORE CODE BELOW --- CORE CODE BELOW --- CORE CODE BELOW ---
  498. -- Clear old tool
  499. player.Backpack:ClearAllChildren()
  500. -- Create tool
  501. local tool = Instance.new("HopperBin")
  502. tool.Parent = player.Backpack
  503. tool.Name = "Air Bending"
  504. -- Tool selected
  505. tool.Selected:connect(function(mouse)
  506. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  507.  
  508. -- Mouse events
  509. mouse.Button1Down:connect(function()
  510. mouseDown = true
  511. end)
  512. mouse.Button1Up:connect(function()
  513. mouseDown = false
  514. end)
  515. mouse.KeyDown:connect(function(key)
  516. keysDown[key:lower()] = true
  517. onKeyChange(mouse, key:lower(), true)
  518. end)
  519. mouse.KeyUp:connect(function(key)
  520. keysDown[key:lower()] = false
  521. onKeyChange(mouse, key:lower(), false)
  522. end)
  523.  
  524. -- Call main
  525. main(mouse)
  526. end)
  527. --- LIBRARY BELOW --- LIBRARY BELOW --- LIBRARY BELOW ---
  528. --- LIBRARY BELOW --- LIBRARY BELOW --- LIBRARY BELOW ---
  529. --- LIBRARY BELOW --- LIBRARY BELOW --- LIBRARY BELOW ---
  530. -- Ray cast
  531. function rayCast(pos, dir, ignore)
  532. return workspace:FindPartOnRayWithIgnoreList(Ray.new(pos, dir), ignore)
  533. end
  534. -- Create body
  535. function createBody(type, path)
  536. local body = Instance.new("Body" .. type)
  537. if type == "Gyro" then
  538. body.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  539. elseif type ~= "Force" then
  540. body.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  541. end
  542. body.Parent = path
  543. return body
  544. end
  545. -- Get parts in region 3
  546. function getPartsInRegion3(region, parts)
  547. repeat
  548. local regParts = workspace:FindPartsInRegion3WithIgnoreList(region, parts, 100)
  549. for i, part in pairs(regParts) do
  550. parts[#parts + 1] = part
  551. end
  552. until #regParts < 100
  553. end
  554. -- Random
  555. function r(min, max)
  556. return math.random()*(max - min) + min
  557. end
  558. -- Plane y
  559. function planeY(v, y)
  560. return Vector3.new(v.x, y or 0, v.z)
  561. end
  562. -- Create Air
  563. function createAir(path)
  564. local part = createPart("Air", path)
  565. part.BrickColor = BrickColor.new("Brown")
  566. part.Material = "Slate"
  567. part.Parent = path
  568. return part
  569. end
  570. function createWater(path)
  571. local part = createPart("Water", path)
  572. part.BrickColor = BrickColor.new("Bright blue")
  573. part.Material = "Ice"
  574. part.Parent = path
  575. return part
  576. end
  577. -- Create part
  578. function createPart(name, path)
  579. local part = Instance.new("Part")
  580. part.FormFactor = "Symmetric"
  581. part.BottomSurface = "Smooth"
  582. part.TopSurface = "Smooth"
  583. part.Size = Vector3.new(9, 7, 8)
  584. part.Name = name
  585. part.Parent = path
  586. return part
  587. end
  588. local player=game.Players.LocalPlayer
  589. local character=player.Character
  590. local head=character["Head"]
  591. local torso=character["Torso"]
  592. local humanoid=character["Humanoid"]
  593. local arm={left=character["Left Arm"], right=character["Right Arm"]}
  594. local add={
  595. part=function(parent,anchored,cancollide,color,shape,t,size,cframe)
  596. local p=Instance.new("Part")
  597. p.Parent=parent
  598. p.TopSurface="Smooth"
  599. p.BottomSurface="Smooth"
  600. p.FormFactor="Custom"
  601. p.Anchored=anchored
  602. p.CanCollide=cancollide
  603. p.BrickColor=BrickColor.new(color)
  604. p.Shape=shape
  605. p.Transparency=t
  606. p.Size=size
  607. p.CFrame=cframe
  608. return p
  609. end,
  610. weld=function(parent,part1,cframe)
  611. local w=Instance.new("Weld")
  612. w.Parent=parent
  613. w.Part0=parent
  614. w.Part1=part1
  615. w.C1=cframe
  616. return w
  617. end,
  618. mesh=function(ins,parent,scale)
  619. local m=Instance.new(ins)
  620. m.Parent=parent
  621. m.Scale=scale
  622. return m
  623. end,
  624. sound=function(parent,volume,id)
  625. local s=Instance.new("Sound")
  626. s.Parent=parent
  627. s.Volume=volume
  628. s.SoundId=id
  629. return s
  630. end,
  631. model=function(parent,name)
  632. local m=Instance.new("Model")
  633. m.Parent=parent
  634. m.Name=name
  635. return m
  636. end,
  637. bg=function(parent,cframe)
  638. local g=Instance.new("BodyGyro")
  639. g.Parent=parent
  640. g.maxTorque=Vector3.new(math.huge,math.huge,math.huge)
  641. g.cframe=cframe
  642. return g
  643. end,
  644. bav=function(parent,angular)
  645. local av=Instance.new("BodyAngularVelocity")
  646. av.maxTorque=Vector3.new(math.huge,math.huge,math.huge)
  647. av.Parent=parent
  648. av.angularvelocity=angular
  649. return av
  650. end,
  651. bp=function(parent,pos)
  652. local p=Instance.new("BodyPosition")
  653. p.Parent=parent
  654. p.maxForce=Vector3.new(0,math.huge,0)
  655. p.position=pos
  656. return p
  657. end,
  658. bf=function(parent,force)
  659. local f=Instance.new("BodyForce")
  660. f.Parent=parent
  661. f.force=force
  662. return f
  663. end,
  664. humanoid=function(parent,maxhealth)
  665. local h=Instance.new("Humanoid")
  666. h.Parent=parent
  667. h.MaxHealth=maxhealth
  668. return h
  669. end
  670. }
  671. local c=function(f)coroutine.resume(coroutine.create(f))end
  672. local trailDeb=false
  673. local things=add.model(character,"Water Bending")
  674.  
  675. function computePos(pos1,pos2)
  676. local pos3=Vector3.new(pos2.x,pos1.y,pos2.z)
  677. return CFrame.new(pos1,pos3)
  678. end
  679.  
  680. local touchDeb=false
  681. function touch(hit)
  682. local human=hit.Parent:findFirstChild("Humanoid")
  683. local torso=hit.Parent:findFirstChild("Torso")
  684. if human and torso and human~=humanoid then
  685. local damage=math.random(5,10)
  686. c(function()
  687. human:TakeDamage(damage)
  688. human.PlatformStand=true
  689. torso.Velocity=torso.CFrame.lookVector*-150
  690. torso.RotVelocity=Vector3.new(math.random(-25,25),math.random(-25,25),math.random(-25,25))
  691. wait(1)
  692. human.PlatformStand=false
  693. torso.Velocity=Vector3.new(0,0,0)
  694. torso.RotVelocity=Vector3.new(0,0,0)
  695. end)
  696. end
  697. end
  698.  
  699. function trail(pos)
  700. trailDeb=true
  701. old=pos.Position
  702. c(function()
  703. while trailDeb==true do
  704. wait()
  705. new=pos.Position
  706. local magnitude=(old-new).magnitude
  707. local line=add.part(things,true,false,"White","Block",0,Vector3.new(9,14,9) ,CFrame.new(old,new)*CFrame.Angles(0,0,-magnitude/2))
  708. old=new
  709. c(function()
  710. for i=.2,1,.2 do
  711. wait()
  712. line.Transparency=i
  713. end
  714. line:remove()
  715. end)
  716. line.Touched:connect(touch)
  717. end
  718. end)
  719. end
  720. local pathDeb=false
  721. local pathPart=nil
  722. local bPosition=10
  723. function path()
  724. pathDeb=true
  725. pathPart=add.part(things,true,true,"White","Block",0,Vector3.new(4,4,4),CFrame.new())
  726. local bp=add.bp(torso,torso.Position+Vector3.new(0,bPosition,0))
  727. while pathDeb==true do
  728. wait()
  729. pathPart.CFrame=torso.CFrame*CFrame.new(0,-4,0)
  730. pathPart.Transparency = 0.6
  731. Mesh = Instance.new("SpecialMesh")
  732. pathPart.Transparency = 0.40000000596046
  733. Mesh.Parent = pathPart
  734. Mesh.MeshType = Enum.MeshType.Sphere
  735. end
  736. end
  737. --Armz
  738. local fakeArm={left=add.part(things,false,false,"Brown","Block",1,Vector3.new(1,1,1),CFrame.new()), right=add.part(things,false,false,"Brown","Block",1,Vector3.new(1,1,1),CFrame.new())}
  739. local water={left=add.part(things,false,false,"Bright blue","Ball",1,Vector3.new(1,1,1),CFrame.new()), right=add.part(things,false,false,"White","Ball",1,Vector3.new(1,1,1),CFrame.new())}
  740. --Weldz
  741. local connectArmWeld={left=add.weld(torso,fakeArm.left,CFrame.new(1.5,-.5,0)), right=add.weld(torso,fakeArm.right,CFrame.new(-1.5,-.5,0))}
  742. local armWeld={left=add.weld(fakeArm.left,arm.left,CFrame.new(0,0.5,0)), right=add.weld(fakeArm.right,arm.right,CFrame.new(0,0.5,0))}
  743. local waterWeld={left=add.weld(water.left,arm.left,CFrame.new(0,-2,0)), right=add.weld(water.right,arm.right,CFrame.new(0,-2,0))}
  744.  
  745. local anim={
  746. equip=function()
  747. for i=.2,1,.2 do
  748. wait()
  749. armWeld.left.C0=CFrame.Angles(math.rad(90)*i,0,math.rad(45)*i)
  750. armWeld.right.C0=CFrame.Angles(math.rad(135)*i,0,0)
  751. end
  752. end,
  753. watersh00t=function(mouse)
  754. torso.CFrame=computePos(torso.CFrame.p,mouse.Hit.p)
  755. trail(water.right)
  756. trail(water.left)
  757. local waterbull=add.part(things,false,false,"White","Ball",0,Vector3.new(30,5,20),CFrame.new((torso.CFrame+torso.CFrame.lookVector*5).p,mouse.hit.p))
  758. waterbull.Touched:connect(touch)
  759. waterbull.Velocity=waterbull.CFrame.lookVector*150
  760. trail(waterbull)
  761. local bf=add.bf(waterbull,Vector3.new(0,waterbull:GetMass()*200.3,1))
  762. for i=.8,1,.2 do
  763. wait()
  764. armWeld.left.C0=CFrame.Angles(math.rad(90)*i,0,math.rad(55)*i)
  765. armWeld.right.C0=CFrame.Angles(math.rad(90)*i,0,-math.rad(60)*i)
  766. waterWeld.left.C1=CFrame.new(5,-7+(-10*i),0)
  767. waterWeld.right.C1=CFrame.new(1,-3+(-10*i),0)
  768. end
  769. wait(.2)
  770. for i=9,0,-.2 do
  771. wait()
  772. armWeld.left.C0=CFrame.Angles(math.rad(90)*i,0,math.rad(45)*i)
  773. armWeld.right.C0=CFrame.Angles(math.rad(90)*i,0,-math.rad(45)*i)
  774. waterWeld.left.C1=CFrame.new(0,-2+(-10*i),0)
  775. waterWeld.right.C1=CFrame.new(0,-2+(-10*i),0)
  776. end
  777. game.Debris:AddItem(waterbull,5)
  778. trailDeb=false
  779. end,
  780. watershoot=function(mouse)
  781. torso.CFrame=computePos(torso.CFrame.p,mouse.Hit.p)
  782. trail(water.left)
  783. trail(water.right)
  784. local waterbull=add.part(things,false,false,"White","Ball",0,Vector3.new(6,6,6),CFrame.new((torso.CFrame+torso.CFrame.lookVector*5).p,mouse.hit.p))
  785. waterbull.Touched:connect(touch)
  786. waterbull.Velocity=waterbull.CFrame.lookVector*150
  787. trail(waterbull)
  788. local bf=add.bf(waterbull,Vector3.new(0,waterbull:GetMass()*196.2,0))
  789. for i=.2,1,.2 do
  790. wait()
  791. armWeld.left.C0=CFrame.Angles(math.rad(90)*i,0,math.rad(45)*i)
  792. armWeld.right.C0=CFrame.Angles(math.rad(90)*i,0,-math.rad(45)*i)
  793. waterWeld.left.C1=CFrame.new(0,-2+(-10*i),0)
  794. waterWeld.right.C1=CFrame.new(0,-2+(-10*i),0)
  795. end
  796. wait(.2)
  797. for i=6,0,-.2 do
  798. wait()
  799. armWeld.left.C0=CFrame.Angles(math.rad(90)*i,0,math.rad(45)*i)
  800. armWeld.right.C0=CFrame.Angles(math.rad(90)*i,0,-math.rad(45)*i)
  801. waterWeld.left.C1=CFrame.new(0,-2+(-10*i),0)
  802. waterWeld.right.C1=CFrame.new(0,-2+(-10*i),0)
  803. end
  804. game.Debris:AddItem(waterbull,9)
  805. trailDeb=false
  806. end,
  807. waterRaise=function(mouse)
  808. torso.CFrame=computePos(torso.CFrame.p,mouse.Hit.p)
  809. trail(water.left)
  810. trail(water.right)
  811. for i=.5,1,.2 do
  812. wait()
  813. armWeld.left.C0=CFrame.Angles(math.rad(135)*i,0,-math.rad(5)*i)
  814. armWeld.right.C0=CFrame.Angles(math.rad(135)*i,0,math.rad(5)*i)
  815. waterWeld.left.C1=CFrame.new(0,-2+(-10*i),0)
  816. waterWeld.right.C1=CFrame.new(0,-2+(-10*i),0)
  817. end
  818. wait(.2)
  819. for i=9,0,-.2 do
  820. wait()
  821. armWeld.left.C0=CFrame.Angles(math.rad(135)*i,0,-math.rad(5)*i)
  822. armWeld.right.C0=CFrame.Angles(math.rad(135)*i,0,math.rad(5)*i)
  823. waterWeld.left.C1=CFrame.new(0,-2+(-math.random(10,12)*i),0)
  824. waterWeld.right.C1=CFrame.new(0,-2+(-math.random(10,12)*i),0)
  825. end
  826. trailDeb=false
  827. end,
  828. waterSpin=function()
  829. trail(water.left)
  830. trail(water.right)
  831. local bg=add.bg(torso,torso.CFrame)
  832. for i=.2,1,.2 do
  833. wait()
  834. armWeld.left.C0=CFrame.Angles(math.rad(90)*i,0,-math.rad(90)*i)
  835. armWeld.right.C0=CFrame.Angles(math.rad(90)*i,0,math.rad(90)*i)
  836. waterWeld.left.C1=CFrame.new(0,-2+(-math.random(5,8)*i),0)
  837. waterWeld.right.C1=CFrame.new(0,-2+(-math.random(5,8)*i),0)
  838. end
  839. local bav=add.bav(torso,Vector3.new(0,75,0))
  840. wait(3)
  841. for i=1,0,-.2 do
  842. wait()
  843. armWeld.left.C0=CFrame.Angles(math.rad(90)*i,0,-math.rad(90)*i)
  844. armWeld.right.C0=CFrame.Angles(math.rad(90)*i,0,math.rad(90)*i)
  845. waterWeld.left.C1=CFrame.new(0,-2+(-5*i),0)
  846. waterWeld.right.C1=CFrame.new(0,-2+(-5*i),0)
  847. end
  848. bg:remove()
  849. bav:remove()
  850. trailDeb=false
  851. end,
  852. bend=function(mouse)
  853. torso.CFrame=computePos(torso.CFrame.p,mouse.Hit.p)
  854. trail(water.left)
  855. trail(water.right)
  856. for i=.2,1,.2 do
  857. wait()
  858. armWeld.left.C0=CFrame.Angles(math.rad(90)*i,0,math.rad(90)*i)
  859. armWeld.right.C0=CFrame.Angles(math.rad(90)*i,0,-math.rad(90)*i)
  860. waterWeld.left.C1=CFrame.new(0,-2+(-10*i),0)
  861. waterWeld.right.C1=CFrame.new(0,-2+(-10*i),0)
  862. end
  863. wait(.2)
  864. for i=4,0,-.2 do
  865. wait()
  866. armWeld.left.C0=CFrame.Angles(math.rad(90)*i,0,math.rad(45)*i)
  867. armWeld.right.C0=CFrame.Angles(math.rad(90)*i,0,-math.rad(45)*i)
  868. waterWeld.left.C1=CFrame.new(0,-2+(-15*i),0)
  869. waterWeld.right.C1=CFrame.new(0,-2+(-15*i),0)
  870. end
  871. trailDeb=false
  872. end,
  873. watershoot2=function(mouse)
  874. torso.CFrame=computePos(torso.CFrame.p,mouse.Hit.p)
  875. trail(water.left)
  876. trail(water.right)
  877. for i=1,40 do
  878. local waterbull=add.part(things,false,false,"Bright blue","Ball",0,Vector3.new(8,8,8),torso.CFrame*CFrame.Angles(0,math.rad(9)*i,0))
  879. waterbull.Velocity=waterbull.CFrame.lookVector*100
  880. trail(waterbull)
  881. local bf=add.bf(waterbull,Vector3.new(0,waterbull:GetMass()*196.2,0))
  882. game.Debris:AddItem(waterbull,5)
  883. waterbull.Touched:connect(touch)
  884. end
  885. for i=.2,1,.2 do
  886. wait()
  887. armWeld.left.C0=CFrame.Angles(math.rad(90)*i,0,math.rad(90)*i)
  888. armWeld.right.C0=CFrame.Angles(math.rad(90)*i,0,-math.rad(90)*i)
  889. waterWeld.left.C1=CFrame.new(0,-2+(-10*i),0)
  890. waterWeld.right.C1=CFrame.new(0,-2+(-10*i),0)
  891. end
  892. wait(.2)
  893. for i=1,0,-.2 do
  894. wait()
  895. armWeld.left.C0=CFrame.Angles(math.rad(90)*i,0,math.rad(90)*i)
  896. armWeld.right.C0=CFrame.Angles(math.rad(90)*i,0,-math.rad(90)*i)
  897. waterWeld.left.C1=CFrame.new(0,-2+(-10*i),0)
  898. waterWeld.right.C1=CFrame.new(0,-2+(-10*i),0)
  899. end
  900. trailDeb=false
  901. end,
  902. AvatarSpecial=function(mouse)
  903. torso.CFrame=computePos(torso.CFrame.p,mouse.Hit.p)
  904. trail(water.left)
  905. trail(water.right)
  906. for i=1,40 do
  907. local waterbull=add.part(things,false,false,"Brown","Ball",0,Vector3.new(10,20,30),torso.CFrame*CFrame.Angles(0,math.rad(9)*i,0))
  908. waterbull.Velocity=waterbull.CFrame.lookVector*100
  909. trail(waterbull)
  910. local bf=add.bf(waterbull,Vector3.new(0,waterbull:GetMass()*196.2,0))
  911. game.Debris:AddItem(waterbull,5)
  912. waterbull.Touched:connect(touch)
  913. end
  914. for i=.2,1,.2 do
  915. wait()
  916. armWeld.left.C0=CFrame.Angles(math.rad(90)*i,0,math.rad(90)*i)
  917. armWeld.right.C0=CFrame.Angles(math.rad(90)*i,0,-math.rad(90)*i)
  918. waterWeld.left.C1=CFrame.new(0,-2+(-10*i),0)
  919. waterWeld.right.C1=CFrame.new(0,-2+(-10*i),0)
  920. end
  921. wait(.2)
  922. for i=1,0,-.2 do
  923. wait()
  924. armWeld.left.C0=CFrame.Angles(math.rad(90)*i,0,math.rad(90)*i)
  925. armWeld.right.C0=CFrame.Angles(math.rad(90)*i,0,-math.rad(90)*i)
  926. waterWeld.left.C1=CFrame.new(0,-2+(-10*i),0)
  927. waterWeld.right.C1=CFrame.new(0,-2+(-10*i),0)
  928. end
  929. trailDeb=false
  930. end,
  931. waterbending2=function(mouse)
  932. torso.CFrame=computePos(torso.CFrame.p,mouse.Hit.p)
  933. trail(water.left)
  934. trail(water.right)
  935. for i=1,40 do
  936. local waterbull=add.part(things,false,false,"Bright blue","Ball",0,Vector3.new(50,20,40),torso.CFrame*CFrame.Angles(0,math.rad(9)*i,0))
  937. waterbull.Velocity=waterbull.CFrame.lookVector*100
  938. trail(waterbull)
  939. local bf=add.bf(waterbull,Vector3.new(0,waterbull:GetMass()*196.2,0))
  940. game.Debris:AddItem(waterbull,5)
  941. waterbull.Touched:connect(touch)
  942. end
  943. for i=.6,1,.2 do
  944. wait()
  945. armWeld.left.C0=CFrame.Angles(math.rad(90)*i ,0,math.rad(90)*i)
  946. armWeld.right.C0=CFrame.Angles(math.rad(90)*i,0,-math.rad(90)*i)
  947. waterWeld.left.C1=CFrame.new(0,-2+(-10*i),0)
  948. waterWeld.right.C1=CFrame.new(0,-2+(-10*i),0)
  949. end
  950. wait(.2)
  951. for i=1,0,-.2 do
  952. wait()
  953. armWeld.left.C0=CFrame.Angles(math.rad(90)*i,0,math.rad(90)*i)
  954. armWeld.right.C0=CFrame.Angles(math.rad(90)*i,0,-math.rad(90)*i)
  955. waterWeld.left.C1=CFrame.new(0,-2+(-10*i),0)
  956. waterWeld.right.C1=CFrame.new(0,-2+(-10*i),0)
  957. end
  958. trailDeb=false
  959. end,
  960. waterBack=function(mouse)
  961. torso.CFrame=computePos(torso.CFrame.p,mouse.Hit.p)
  962. trail(water.left)
  963. trail(water.right)
  964. for i=.2,1,.2 do
  965. wait()
  966. armWeld.left.C0=CFrame.Angles(math.rad(90)*i,0,0)
  967. armWeld.right.C0=CFrame.Angles(math.rad(90)*i,0,0)
  968. waterWeld.left.C1=CFrame.new(0,-2+(-20*i),0)
  969. waterWeld.right.C1=CFrame.new(0,-2+(-20*i),0)
  970. end
  971. wait(.2)
  972. for i=1,0,-.2 do
  973. wait()
  974. armWeld.left.C0=CFrame.Angles(math.rad(90)*i,0,0)
  975. armWeld.right.C0=CFrame.Angles(math.rad(90)*i,0,0)
  976. waterWeld.left.C1=CFrame.new(0,-2+(-20*i),0)
  977. waterWeld.right.C1=CFrame.new(0,-2+(-20*i),0)
  978. end
  979. trailDeb=false
  980. end,
  981. waterForward=function(mouse)
  982. torso.CFrame=computePos(torso.CFrame.p,mouse.Hit.p)
  983. torso.Anchored=true
  984. for i=.2,1,.2 do
  985. wait()
  986. armWeld.left.C0=CFrame.Angles(math.rad(135)*i,0,-math.rad(5)*i)
  987. armWeld.right.C0=CFrame.Angles(math.rad(135)*i,0,math.rad(5)*i)
  988. end
  989. for i=1,20 do
  990. wait()
  991. local waterblock=add.part(things,false,false,"Bright blue","Block",0,Vector3.new(9,7,9),torso.CFrame*CFrame.new(0,0,0)*CFrame.Angles(math.rad(45),0,0)+torso.CFrame.lookVector*2*i)
  992. trail(waterblock)
  993. game.Debris:AddItem(waterblock,1)
  994. waterblock.Touched:connect(touch)
  995. end
  996. wait(.2)
  997. torso.Anchored=false
  998. for i=1,0,-.2 do
  999. wait()
  1000. armWeld.left.C0=CFrame.Angles(math.rad(135)*i,0,-math.rad(5)*i)
  1001. armWeld.right.C0=CFrame.Angles(math.rad(135)*i,0,math.rad(5)*i)
  1002. end
  1003. trailDeb=false
  1004. end
  1005. }
  1006.  
  1007. function getTouched()
  1008. for i,v in pairs(things:GetChildren()) do
  1009. v.Touched:connect(touch)
  1010. end
  1011. end
  1012.  
  1013. local deb=false
  1014. local buttonDeb=false
  1015. local bin=Instance.new("HopperBin")
  1016. bin.Parent=player.Backpack
  1017. bin.Name="Avatar State"
  1018. bin.Selected:connect(function(mouse)
  1019. bin:remove()
  1020. anim.equip()
  1021. mouse.Button1Down:connect(function()
  1022. if deb==false then
  1023. deb=true
  1024. getTouched()
  1025. anim.watershoot(mouse)
  1026. anim.equip()
  1027. deb=false
  1028. end
  1029. end)
  1030. mouse.KeyDown:connect(function(key)
  1031. if key=="q" and deb==false then
  1032. deb=true
  1033. getTouched()
  1034. anim.waterRaise(mouse)
  1035. anim.equip()
  1036. deb=false
  1037. end
  1038. if key=="e" and deb==false then
  1039. deb=true
  1040. getTouched()
  1041. anim.waterSpin()
  1042. anim.equip()
  1043. deb=false
  1044. end
  1045. if key=="r" and deb==false then
  1046. deb=true
  1047. getTouched()
  1048. anim.bend(mouse)
  1049. anim.equip()
  1050. deb=false
  1051. end
  1052. if key=="f" and deb==false then
  1053. deb=true
  1054. getTouched()
  1055. anim.watershoot2(mouse)
  1056. anim.equip()
  1057. deb=false
  1058. end
  1059. if key=="c" and deb==false then
  1060. deb=true
  1061. getTouched()
  1062. anim.AvatarSpecial(mouse)
  1063. anim.equip()
  1064. deb=false
  1065. end
  1066. if key=="v" and deb==false then
  1067. deb=true
  1068. getTouched()
  1069. anim.waterbending2(mouse)
  1070. anim.equip()
  1071. deb=false
  1072. end
  1073. if key=="p" and deb==false then
  1074. deb=true
  1075. getTouched()
  1076. anim.watersh00t(mouse)
  1077. anim.equip()
  1078. deb=false
  1079. end
  1080. if key=="g" and deb==false then
  1081. deb=true
  1082. getTouched()
  1083. anim.waterBack(mouse)
  1084. anim.equip()
  1085. deb=false
  1086. end
  1087. if key=="h" and deb==false then
  1088. deb=true
  1089. getTouched()
  1090. anim.waterForward(mouse)
  1091. anim.equip()
  1092. deb=false
  1093. end
  1094. if key=="z" and buttonDeb==false then
  1095. buttonDeb=true
  1096. getTouched()
  1097. path()
  1098. end
  1099. if key=="z" and buttonDeb==true then
  1100. buttonDeb=false
  1101. pathPart:remove() torso["BodyPosition"]:remove()
  1102. end
  1103. end)
  1104. end)
  1105. --mediafire gtfo password
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement