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