Advertisement
DerpCatz

ROBLOX Avatar SCRIPT (change your name with mine)

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