Advertisement
Stefanuk12

ROBLOX Script Builder Scripts ( Lotus Sword )

Jul 2nd, 2016
674
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 25.38 KB | None | 0 0
  1. --MADE BY OneLegend (NOT THE SCRIPT) Thanks to CyberFromLU for letting me Publish! LOCAL SCRIPT: JUST RUN!
  2. -------------------------------------------------------------------------------------
  3. Players = game:GetService("StefanukSwAg")
  4. Me = Players.LocalPlayer
  5. Char = Me.Character
  6. necko = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  7. ShootColors = {"Bright yellow", "New Yeller", "Bright orange", "Neon orange", "Really red", "Bright red"}
  8. PlaceId = game.PlaceId
  9.  
  10. Selected = false
  11. Attacking = false
  12. Accuracy = 5
  13. Debounce = true
  14. Hurt = false
  15. Damage = {15,42}
  16.  
  17. ContentProvider = game:GetService("ContentProvider")
  18.  
  19. V3 = Vector3.new
  20. C3 = Color3.new
  21. BN = BrickColor.new
  22. CN = CFrame.new
  23. CA = CFrame.Angles
  24. MR = math.rad
  25. MRA = math.random
  26. MP = math.pi
  27. MH = math.huge
  28. UD = UDim2.new
  29.  
  30. function RC(Pos, Dir, Max, Ignore)
  31.     return workspace:FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999)), Ignore)
  32. end
  33.  
  34. function RayC(Start, En, MaxDist, Ignore)
  35.     return RC(Start, (En - Start), MaxDist, Ignore)
  36. end
  37.  
  38. function ComputePos(pos1, pos2)
  39.     return CN(pos1, V3(pos2.x, pos1.y, pos2.z))
  40. end
  41.  
  42. function DetectSurface(pos, part)
  43.     local surface = nil
  44.     local pospos = part.CFrame
  45.     local pos2 = pospos:pointToObjectSpace(pos)
  46.     local siz = part.Size
  47.     local shaep = part.Shape
  48.     if shaep == Enum.PartType.Ball or shaep == Enum.PartType.Cylinder then
  49.         surface = {"Anything", CN(pospos.p, pos)*CN(0, 0, -(pospos.p - pos).magnitude)*CA(MR(-90), 0, 0)}
  50.     else
  51.         if pos2.Y > ((siz.Y/2)-0.04) then
  52.             surface = {"Top", CA(0, 0, 0)}
  53.         elseif pos2.Y < -((siz.Y/2)-0.04) then
  54.             surface = {"Bottom", CA(-MP, 0, 0)}
  55.         elseif pos2.X > ((siz.X/2)-0.04) then
  56.             surface = {"Right", CA(0, 0, MR(-90))}
  57.         elseif pos2.X < -((siz.X/2)-0.04) then
  58.             surface = {"Left", CA(0, 0, MR(90))}
  59.         elseif pos2.Z > ((siz.Z/2)-0.04) then
  60.             surface = {"Back", CA(MR(90), 0, 0)}
  61.         elseif pos2.Z < -((siz.Z/2)-0.04) then
  62.             surface = {"Front", CA(MR(-90), 0, 0)}
  63.         end
  64.     end
  65.     return surface
  66. end
  67.  
  68. function Compute(pos1, pos2)
  69.     local pos3 = Vector3.new(pos2.x, pos1.y, pos2.z)
  70.     return CN(pos1, pos3)
  71. end
  72.  
  73. function waitChild(n, p)
  74.     local c = p:findFirstChild(n)
  75.     if c then return c end
  76.     while true do
  77.         c = p.ChildAdded:wait()
  78.         if c.Name == n then return c end
  79.     end
  80. end
  81.  
  82. function Notime(func)
  83.     coroutine.resume(coroutine.create(function()
  84.         func()
  85.     end))
  86. end
  87.  
  88. Torso = waitChild("Torso", Char)
  89. Head = waitChild("Head", Char)
  90. Rarm = waitChild("Right Arm", Char)
  91. Larm = waitChild("Left Arm", Char)
  92. Rleg = waitChild("Right Leg", Char)
  93. Lleg = waitChild("Left Leg", Char)
  94. Neck = waitChild("Neck", Torso)
  95. Hum = waitChild("Humanoid", Char)
  96.  
  97. RSH = waitChild("Right Shoulder", Torso)
  98. LSH = waitChild("Left Shoulder", Torso)
  99. RH = waitChild("Right Hip", Torso)
  100. LH = waitChild("Left Hip", Torso)
  101.  
  102. RSH.Part0 = Torso
  103. LSH.Part0 = Torso
  104. RH.Part0 = Torso
  105. LH.Part0 = Torso
  106.  
  107. Add = {
  108.     Mesh = function(P, ID, Scale, Tex)
  109.         local m = Instance.new("SpecialMesh")
  110.         m.MeshType = "FileMesh"
  111.         m.MeshId = ID or ""
  112.         m.Scale = Scale or V3(1, 1, 1)
  113.         m.TextureId = Tex or ""
  114.         m.Parent = P
  115.         return m
  116.     end,
  117.     Sphere = function(P, Scale)
  118.         local m = Instance.new("SpecialMesh")
  119.         m.MeshType = "Sphere"
  120.         m.Scale = Scale or V3(1, 1, 1)
  121.         m.Parent = P
  122.         return m
  123.     end
  124. }
  125.  
  126. Sounds = {
  127.     Shoot = {Id = "http://www.roblox.com/asset/?id=2697431", Pitch = 0.3, Volume = 0.5},
  128.     Boom = {Id = "http://www.roblox.com/asset/?id=2692806", Pitch = 0.55, Volume = 0.4},
  129.     Slash = {Id = "rbxasset://sounds//swordslash.wav", Pitch = 0.5, Volume = 0.5},
  130.     Hit = {Id = "http://www.roblox.com/asset/?id=2801263", Pitch = 0.85, Volume = 0.35},
  131.     Reload = {Id = "rbxasset://sounds\\metal.ogg", Pitch = 1, Volume = 0.45},
  132. }
  133.  
  134. for _,v in pairs(Sounds) do
  135.     ContentProvider:Preload(v.Id)
  136. end
  137.  
  138. function PlaySound(Sound, bool)
  139.     local s = Instance.new("Sound")
  140.     s.Looped = false
  141.     s.Volume = Sound.Volume
  142.     s.SoundId = Sound.Id
  143.     if bool then
  144.         s.Pitch = MRA((Sound.Pitch*0.75)*1000, (Sound.Pitch*1.15)*1000)/1000
  145.     else
  146.         s.Pitch = Sound.Pitch
  147.     end
  148.     s.PlayOnRemove = true
  149.     s.Parent = Torso
  150.     Notime(function()
  151.         wait()
  152.         s.Parent = nil
  153.     end)
  154. end
  155.  
  156. function GetParts(pos, dist)
  157.     local parts = {}
  158.     local function o(p)
  159.         for _,v in pairs(p:children()) do
  160.             if v:IsA("BasePart") then
  161.                 if (pos - v.Position).magnitude <= dist then
  162.                     table.insert(parts, {v, (pos - v.Position).magnitude, v.Anchored})
  163.                 end
  164.             end
  165.             o(v)
  166.         end
  167.     end
  168.     o(workspace)
  169.     return parts
  170. end
  171.  
  172. function GetHum(P)
  173.     for _,v in pairs(P:children()) do
  174.         if v:IsA("Humanoid") then
  175.             if v.Health > 0 then
  176.                 return v
  177.             end
  178.         end
  179.     end
  180. end
  181.  
  182. function GetGroup(Pos, Distance, Hit)
  183.     local tab = {}
  184.     for _,v in pairs(workspace:children()) do
  185.         local h = GetHum(v)
  186.         local t = v:findFirstChild("Torso")
  187.         if h and t and v ~= Hit.Parent then
  188.             if (t.Position - Pos).magnitude <= Distance then
  189.                 table.insert(tab, {h, v, (t.Position - Pos).magnitude})
  190.             end
  191.         end
  192.     end
  193.     if Hit then
  194.         local h = GetHum(Hit.Parent)
  195.         if h then
  196.             table.insert(tab, {h, Hit.Parent, 0})
  197.         end
  198.     end
  199.     return tab
  200. end
  201.  
  202. function Tag(hum)
  203.     if PlaceId == 48513881 then
  204.         local tag = Instance.new("ObjectValue")
  205.         tag.Name = "creator"
  206.         tag.Value = Me
  207.         tag.Parent = hum
  208.     end
  209. end
  210.  
  211. function Part(Par, Anc, Colli, Tran, Ref, Col, Siz)
  212.     local p = Instance.new("Part")
  213.     p.formFactor = "Custom"
  214.     p.TopSurface = 0
  215.     p.BottomSurface = 0
  216.     p.Transparency = Tran
  217.     p.Reflectance = Ref
  218.     p.Anchored = Anc
  219.     p.CanCollide = Colli
  220.     p.BrickColor = Col
  221.     p.Size = Siz
  222.     p.Locked = true
  223.     p.Parent = Par
  224.     p:BreakJoints()
  225.     return p
  226. end
  227.  
  228. function Weld(P0, P1, C0, C1)
  229.     local w = Instance.new("Weld")
  230.     w.Part0 = P0
  231.     w.Part1 = P1
  232.     if C0 then
  233.         w.C0 = C0
  234.     end
  235.     if C1 then
  236.         w.C1 = C1
  237.     end
  238.     w.Parent = P0
  239.     return w
  240. end
  241.  
  242. for _,v in pairs(Char:children()) do
  243.     if v.Name == "Hand Cannon" then
  244.         v:remove()
  245.     end
  246. end
  247.  
  248. Model = Instance.new("Model")
  249. Model.Name = "Hand Cannon"
  250.  
  251. FTorso = Part(Model, false, false, 1, 0, Torso.BrickColor, V3(2, 2, 1))
  252. FW = Weld(Torso, FTorso)
  253.  
  254. RAB = Part(Model, false, false, 1, 0, BN("White"), V3(0.2, 0.2, 0.2))
  255. LAB = Part(Model, false, false, 1, 0, BN("White"), V3(0.2, 0.2, 0.2))
  256. RLB = Part(Model, false, false, 1, 0, BN("White"), V3(0.2, 0.2, 0.2))
  257. LLB = Part(Model, false, false, 1, 0, BN("White"), V3(0.2, 0.2, 0.2))
  258.  
  259. RABW = Weld(Torso, RAB, CN(), CN(-1.5, -0.5, 0))
  260. LABW = Weld(Torso, LAB, CN(), CN(1.5, -0.5, 0))
  261. RLBW = Weld(Torso, RLB, CN(), CN(-0.5, 1, 0))
  262. LLBW = Weld(Torso, LLB, CN(), CN(0.5, 1, 0))
  263.  
  264. RAW = Weld(RAB, nil, CN(), CN(0, 0.5, 0))
  265. LAW = Weld(LAB, nil, CN(), CN(0, 0.5, 0))
  266. RLW = Weld(RLB, nil, CN(), CN(0, 1, 0))
  267. LLW = Weld(LLB, nil, CN(), CN(0, 1, 0))
  268.  
  269. TW = Weld(Torso, nil, CN(0.7, 0.8, 1.2), CA(0, MR(180), MR(55)))
  270.  
  271. Weapon = Instance.new("Model")
  272. Weapon.Name = "Cannon"
  273.  
  274. HB = Part(Weapon, false, false, 1, 0, BN("White"), V3(0.2, 0.2, 0.2))
  275. HBW = Weld(Rarm, HB, CN(0, -0.7, 0), CA(0, MR(90), MR(90)))
  276. HW = Weld(HB, nil)
  277.  
  278. Handle = Part(Weapon, false, false, 0, 0, BN("Dark grey"), V3(0.5, 0.5, 0.3))
  279. Add.Mesh(Handle, "http://www.roblox.com/asset/?id=3270017", V3(1, 0.7, 2.2), "")
  280. TW.Part1 = Handle
  281.  
  282. Main = Part(Weapon, false, false, 0, 0, BN("Dark grey"), V3(1.5, 1.5, 2.5))
  283. Add.Mesh(Main, "http://www.roblox.com/asset/?id=3270017", V3(1.6, 1.6, 15), "")
  284. Weld(Handle, Main, CA(0, MR(90), MR(90)), CN(1, 0, 0.2))
  285.  
  286. Main2 = Part(Weapon, false, false, 0, 0, BN("Gun metallic"), V3(1, 1, 1.5))
  287. Add.Mesh(Main2, "http://www.roblox.com/asset/?id=3270017", V3(1.2, 1.2, 8), "")
  288. Weld(Main, Main2, CN(), CN(0, 0, 1.7))
  289.  
  290. Handle2 = Part(Weapon, false, false, 0, 0, BN("Dark grey"), V3(0.5, 0.5, 0.3))
  291. Add.Mesh(Handle2, "http://www.roblox.com/asset/?id=3270017", V3(0.7, 0.8, 2.2), "")
  292. Weld(Main2, Handle2, CA(0, MR(90), MR(90)), CN(-0.65, 0, 0))
  293.  
  294. Tip = Part(Weapon, false, false, 0, 0, BN("Earth yellow"), V3(1.6, 1.6, 0.6))
  295. Add.Sphere(Tip, V3(1.05, 1.05, 1))
  296. Weld(Main, Tip, CN(), CN(0, 0, -1.15))
  297.  
  298. Tip4 = Part(Weapon, false, false, 0, 0, BN("Black"), V3(1.2, 1.2, 0.3))
  299. Add.Mesh(Tip4, "http://www.roblox.com/asset/?id=3270017", V3(1.7, 1.7, 10), "")
  300. Weld(Main, Tip4, CN(), CN(0, 0, -0.15))
  301.  
  302. for i = 1.3, 1.45, 0.1 do
  303.     local Tip3 = Part(Weapon, false, false, 0, 0, BN("Dark grey"), V3(1.2, 1.2, 0.3))
  304.     Add.Mesh(Tip3, "http://www.roblox.com/asset/?id=3270017", V3(i, i, 2), "")
  305.     Weld(Main2, Tip3, CN(), CN(0, 0, 0.6))
  306. end
  307.  
  308. for i = -0.95, 0.66, 1.55 do
  309.     local Tip3 = Part(Weapon, false, false, 0, 0, BN("Dark Curry"), V3(1.2, 1.2, 0.3))
  310.     Add.Mesh(Tip3, "http://www.roblox.com/asset/?id=3270017", V3(1.65, 1.65, 3), "")
  311.     Weld(Main, Tip3, CN(), CN(0, 0, i))
  312. end
  313.  
  314. for i = 1.3, 1.5, 0.1 do
  315.     local Tip2 = Part(Weapon, false, false, 0, 0, BN("Earth yellow"), V3(1.6, 1.6, 0.6))
  316.     Add.Mesh(Tip2, "http://www.roblox.com/asset/?id=3270017", V3(i, i, 2), "")
  317.     Weld(Main, Tip2, CN(), CN(0, 0, 1.1))
  318. end
  319.  
  320. for i = -0.3, 1, 0.15 do
  321.     local p = Part(Weapon, false, false, 0.7, 0, BN("Black"), V3(0.2, 0.2, 0.2))
  322.     Add.Sphere(p, V3(6, 6, 2))
  323.     Weld(Main2, p, CN(0, 0, i))
  324. end
  325.  
  326. function Show_Damage(P, D)
  327.     local mo = Instance.new("Model")
  328.     mo.Name = "- "..D
  329.     local p = Part(mo, false, false, 0, 0, BN("Bright red"), V3(0.2, 0.2, 0.2))
  330.     p.Name = "Head"
  331.     local m = Instance.new("SpecialMesh")
  332.     m.MeshType = "Brick"
  333.     m.Scale = Vector3.new(4.5, 2.3, 4.5)
  334.     m.Parent = p
  335.     local bp = Instance.new("BodyPosition", p)
  336.     bp.maxForce = V3(MH, MH, MH)
  337.     bp.P = 9001
  338.     bp.position = CN(P) * CN(0, 1.5, 0).p
  339.     local h = Instance.new("Humanoid")
  340.     h.Health = 0
  341.     h.MaxHealth = 0
  342.     h.Name = "asd"
  343.     h.Parent = mo
  344.     local nah = true
  345.     mo.Parent = workspace
  346.     p.CFrame = CN(P)
  347.     Notime(function()
  348.         wait(1.5)
  349.         for i = 0, 1, 0.05 do
  350.             p.Transparency = i
  351.             if nah then mo.Name = "" nah = false else mo.Name = "- "..D nah = true end
  352.             wait()
  353.         end
  354.         mo:remove()
  355.     end)
  356. end
  357.  
  358. function Kill(hit)
  359.     if Debounce and Hurt then
  360.         local Hu = GetHum(hit.Parent)
  361.         if Hu then
  362.             Debounce = false
  363.             local Dmg = MRA(Damage[1], Damage[2])
  364.             Hu.Health = Hu.Health - Dmg
  365.             Show_Damage(Tip.Position, Dmg)
  366.             PlaySound(Sounds.Hit, true)
  367.             Tag(Hu)
  368.             local chance = MRA(1, 10)
  369.             if chance >=5 then
  370.                 Hu.PlatformStand = true
  371.                 wait(0.15)
  372.                 hit.Velocity = (CN(Torso.CFrame * CN(0, 0.5, 0).p, hit.Position).lookVector * 45)
  373.                 hit.RotVelocity = V3(MRA(-10, 10), MRA(-10, 10), MRA(-10, 10))
  374.                 wait(0.3)
  375.                 Hu.PlatformStand = false
  376.             end
  377.         end
  378.     end
  379. end
  380.  
  381. Main.Touched:connect(Kill)
  382.  
  383. Weapon.Parent = Model
  384. Model.Parent = Char
  385.  
  386. if script.Parent.className ~= "HopperBin" then
  387.     h = Instance.new("HopperBin", Me.Backpack)
  388.     h.Name = "Hand Cannon"
  389.     script.Parent = h
  390. end
  391.  
  392. bin = script.Parent
  393.  
  394. function Attach(t)
  395.     RSH.Part0 = t
  396.     LSH.Part0 = t
  397.     RH.Part0 = t
  398.     LH.Part0 = t
  399.     RABW.Part0 = t
  400.     LABW.Part0 = t
  401.     LLBW.Part0 = t
  402.     RLBW.Part0 = t
  403.     if t == Torso then
  404.         FTorso.Transparency = 1
  405.     else
  406.         Torso.Transparency = 1
  407.     end
  408.     t.Transparency = 0
  409. end
  410.  
  411. function SelectAnim()
  412.     RAW.Part1 = Rarm
  413.     for i = 0.25, 1, 0.25 do
  414.         RAW.C0 = CA(MR(-10*i), 0, MR(-5*i))
  415.         wait()
  416.     end
  417.     for i = 0.1, 1, 0.1 do
  418.         RAW.C0 = CA(MR(-10-90*i), 0, MR(-5-30*i))
  419.         wait()
  420.     end
  421.     for i = 0.5, 1, 0.5 do
  422.         RAW.C0 = CA(MR(-100-5*i), 0, MR(-35))
  423.         wait()
  424.     end
  425.     HW.Part1 = Handle
  426.     HW.C0 = CA(MR(50), 0, MR(-37))
  427.     TW.Part1 = nil
  428.     Attach(FTorso)
  429.     LAW.Part1 = Larm
  430.     for i = 0.25, 1, 0.25 do
  431.         RAW.C0 = CA(MR(-105+10*i), 0, MR(-35+5*i))
  432.         LAW.C0 = CA(MR(15*i), 0, MR(5*i))
  433.         FW.C0 = CA(0, MR(-5*i), 0)
  434.         HW.C0 = CA(MR(50-5*i), 0, MR(-37))
  435.         wait()
  436.     end
  437.     for i = 0.06, 1, 0.06 do
  438.         RAW.C0 = CA(MR(-95+95*i), MR(35*i), MR(-30+50*i))
  439.         LAW.C0 = CA(MR(15+25*i), 0, MR(5+15*i)) * CN(0, -0.4*i, 0)
  440.         FW.C0 = CA(0, MR(-5-30*i), 0)
  441.         HW.C0 = CA(MR(45), 0, MR(-37+15*i))
  442.         wait()
  443.     end
  444.     Hum.WalkSpeed = 10
  445.     for i = 0.1, 1, 0.1 do
  446.         RAW.C0 = CA(MR(15*i), MR(35+10*i), MR(20+8*i))
  447.         LAW.C0 = CA(MR(40+7*i), 0, MR(20+6*i)) * CN(0, -0.4-0.2*i, 0)
  448.         FW.C0 = CA(0, MR(-35-10*i), 0)
  449.         HW.C0 = CA(MR(45-11*i), 0, MR(-22+15*i))
  450.         wait()
  451.     end
  452.     for i = 0.25, 1, 0.25 do
  453.         RAW.C0 = CA(MR(15+5*i), MR(45+5*i), MR(28+2*i))
  454.         LAW.C0 = CA(MR(47+3*i), 0, MR(26+4*i)) * CN(0, -0.6, 0)
  455.         FW.C0 = CA(0, MR(-45-5*i), 0)
  456.         HW.C0 = CA(MR(34-4*i), 0, MR(-7+7*i))
  457.         wait()
  458.     end
  459. end
  460.  
  461. function DeselAnim()
  462.     for i = 0.25, 1, 0.25 do
  463.         RAW.C0 = CA(MR(20-5*i), MR(50-5*i), MR(30-5*i))
  464.         LAW.C0 = CA(MR(50-5*i), 0, MR(30-5*i)) * CN(0, -0.6+0.1*i, 0)
  465.         FW.C0 = CA(0, MR(-50+5*i), 0)
  466.         HW.C0 = CA(MR(30+5*i), 0, MR(-10*i))
  467.         wait()
  468.     end
  469.     for i = 0.15, 1, 0.15 do
  470.         RAW.C0 = CA(MR(15-30*i), MR(45-10*i), MR(25-5*i))
  471.         LAW.C0 = CA(MR(45-20*i), 0, MR(25-15*i)) * CN(0, -0.5+0.2*i, 0)
  472.         FW.C0 = CA(0, MR(-45+10*i), 0)
  473.         HW.C0 = CA(MR(35+10*i), 0, MR(-10-15*i))
  474.         wait()
  475.     end
  476.     for i = 0.12, 1, 0.12 do
  477.         RAW.C0 = CA(MR(-15-70*i), MR(35-30*i), MR(20-30*i))
  478.         LAW.C0 = CA(MR(25-25*i), 0, MR(10-10*i)) * CN(0, -0.3+0.3*i, 0)
  479.         FW.C0 = CA(0, MR(-35+20*i), 0)
  480.         HW.C0 = CA(MR(45+5*i), 0, MR(-25-12*i))
  481.         wait()
  482.     end
  483.     LAW.Part1 = nil
  484.     HW.C0 = CA(MR(50), 0, MR(-37))
  485.     for i = 0.25, 1, 0.25 do
  486.         RAW.C0 = CA(MR(-85-20*i), MR(5-5*i), MR(-10-25*i))
  487.         FW.C0 = CA(0, MR(-15+15*i), 0)
  488.         wait()
  489.     end
  490.     Attach(Torso)
  491.     HW.Part1 = nil
  492.     TW.Part1 = Handle
  493.     Hum.WalkSpeed = 16
  494.     for i = 0.15, 1, 0.15 do
  495.         RAW.C0 = CA(MR(-105+95*i), 0, MR(-35+30*i))
  496.         wait()
  497.     end
  498.     for i = 0.33, 1, 0.33 do
  499.         RAW.C0 = CA(MR(-10+10*i), 0, MR(-5+5*i))
  500.         wait()
  501.     end
  502.     RAW.Part1 = nil
  503. end
  504.  
  505. --Norms:
  506. --RAW.C0 = CA(MR(20), MR(50), MR(30))
  507. --LAW.C0 = CA(MR(50), 0, MR(30)) * CN(0, -0.6, 0)
  508. --FW.C0 = CA(0, MR(-50), 0)
  509. --HW.C0 = CA(MR(30), 0, 0)
  510. --
  511. --
  512.  
  513. function Explode(Par, Pos, surface)
  514.     Notime(function()
  515.         local cf = CN(Pos) * CA(Par.CFrame:toEulerAnglesXYZ()) * surface[2] * CN(0, 1, 0)
  516.         if surface[1] == "Anything" then
  517.             cf = surface[2]
  518.         end
  519.         local col = Par.BrickColor.Color
  520.         local r, g, b = col.r, col.g, col.b
  521.         local col1, col2, col3 = C3(MRA(r*60, r*100)/100, MRA(g*60, g*100)/100, MRA(b*60, b*100)/100), C3(MRA(r*60, r*100)/100, MRA(g*60, g*100)/100, MRA(b*60, b*100)/100), C3(MRA(r*60, r*100)/100, MRA(g*60, g*100)/100, MRA(b*60, b*100)/100)
  522.         local p = Part(workspace, true, false, 0, 0, BN(col1.r, col1.g, col1.b), V3(0.2, 0.2, 0.2))
  523.         local p2 = Part(workspace, true, false, 0, 0, BN(col2.r, col2.g, col2.b), V3(0.2, 0.2, 0.2))
  524.         local p3 = Part(workspace, true, false, 0, 0, BN(col3.r, col3.g, col3.b), V3(0.2, 0.2, 0.2))
  525.         p.CFrame = cf
  526.         p2.CFrame = cf
  527.         p3.CFrame = cf
  528.         local m = Add.Mesh(p, "http://www.roblox.com/asset/?id=20329976", V3(1, 1, 1))
  529.         local m2 = Add.Mesh(p2, "http://www.roblox.com/asset/?id=20329976", V3(1, 1, 1))
  530.         local m3 = Add.Mesh(p3, "http://www.roblox.com/asset/?id=20329976", V3(1, 1, 1))
  531.         for i = -0.2, 1, 0.12 do
  532.             p2.Transparency = i+0.1
  533.             p.Transparency = i
  534.             p3.Transparency = i+0.2
  535.             m.Scale = V3(1+2.5*i, 1.4+1*i, 1+2.5*i)
  536.             m2.Scale = V3(0.8+2*i, 1.2+1*i, 0.8+2*i)
  537.             m3.Scale = V3(0.5+1*i, 1+1*i, 0.5+1*i)
  538.             wait()
  539.         end
  540.         p2:remove()
  541.         p3:remove()
  542.         p:remove()
  543.     end)
  544. end
  545.  
  546. function Shoot(Pos)
  547.     coroutine.resume(coroutine.create(function()
  548.     local acc = Accuracy*100
  549.     local Start = Main2.CFrame * CN(0, 0, -0.5).p
  550.     local Face = CN(Start, Pos) * CA(MR(MRA(-acc, acc))/100, MR(MRA(-acc, acc))/100, MR(MRA(-acc, acc))/100)
  551.     local Cannonball = Part(Model, true, false, 0, 0, BN("Black"), V3(1.3, 1.3, 1.3))
  552.     Add.Sphere(Cannonball)
  553.     Cannonball.CFrame = Face
  554.     local Go = 3
  555.     local Drop = 0.55/(Go*3)
  556.     local Dist = 500
  557.     local lastP = Start
  558.     local omg = 0
  559.     for i = Go, Dist, Go do
  560.         Drop = Drop + 1/(Go*3)
  561.         omg = omg + Drop
  562.         local dropping = CA(MR(-Drop), 0, 0)
  563.         if omg > 130 then
  564.             dropping = CN()
  565.         end
  566.         Face = Face * dropping * CN(0, 0, -Go)
  567.         Cannonball.CFrame = Face
  568.         local Magn = (Face.p - lastP).magnitude
  569.         local T = Part(Model, true, false, 0.1, 0, BN("Mid gray"), V3(0.2, 1, 0.2))
  570.         local M = Instance.new("SpecialMesh",T)
  571.         M.MeshType = "Head"
  572.         M.Scale = V3(5, Magn, 5)
  573.         T.CFrame = CN(lastP, Face.p) * CA(MR(-90), 0, 0) * CN(0, Magn/2, 0)
  574.         Notime(function()
  575.             wait(0.1)
  576.             for i = 0.1, 1, 0.1 do
  577.                 T.Transparency = i+0.1
  578.                 M.Scale = V3(5-5*i, Magn+0.5, 5-5*i)
  579.                 wait()
  580.             end
  581.             T:remove()
  582.         end)
  583.         local Hit, Hitpos = RayC(lastP, Face.p, Go*2, Char)
  584.         lastP = Face.p
  585.         if Hit then
  586.             PlaySound(Sounds.Boom, true)
  587.             local s = DetectSurface(Hitpos, Hit)
  588.             Explode(Hit, Hitpos, s)
  589.             Cannonball.CFrame = CN(Hitpos)
  590.             local hu = GetHum(Hit.Parent)
  591.             if hu == nil and Hit.Parent.className ~= "Hat" and Hit.Anchored then
  592.                 coroutine.resume(coroutine.create(function()
  593.                     wait(10)
  594.                     for i = 0, 1, 0.04 do
  595.                         Cannonball.Transparency = i
  596.                         wait()
  597.                     end
  598.                     Cannonball:remove()
  599.                 end))
  600.             else
  601.                 Cannonball:remove()
  602.             end
  603.             local Noobs = GetGroup(Hitpos, 5, Hit)
  604.             for _,v in pairs(Noobs) do
  605.                 local dm = 60/((v[3]+3)/3)
  606.                 dm = MRA(dm*0.9, dm*1.04)
  607.                 v[1].Health = v[1].Health - dm
  608.                 local t = v[2]:findFirstChild("Head")
  609.                 if t then
  610.                     Show_Damage(t.Position, dm)
  611.                 end
  612.                 pcall(function()
  613.                 Tag(v[1])
  614.                 end)
  615.             end
  616.             local Parts = GetParts(Hitpos, 7)
  617.             for _,v in pairs(Parts) do
  618.                 if v[3] == false then
  619.                     Notime(function()
  620.                         if v[1].Name == "Brick wall" then
  621.                             v[1]:BreakJoints()
  622.                             v[1].Velocity = (CN(Hitpos, v[1].Position).lookVector * (110/((v[2]+2)/3)))
  623.                             wait(0.1)
  624.                             v[1].Velocity = (CN(Hitpos, v[1].Position).lookVector * (110/((v[2]+2)/3)))
  625.                         else
  626.                             v[1].Velocity = (CN(Hitpos, v[1].Position).lookVector * (80/((v[2]+2)/3)))
  627.                         end
  628.                     end)
  629.                 end
  630.             end
  631.             break
  632.         end
  633.         wait()
  634.     end
  635.     end))
  636. end
  637.  
  638. function ShootAnim(pos)
  639.     RLW.Part1 = Rleg
  640.     LLW.Part1 = Lleg
  641.     local cf = ComputePos(Torso.Position, pos)
  642.     local bp = Instance.new("BodyPosition",Torso)
  643.     bp.maxForce = V3(MH, 0, MH)
  644.     bp.P = 10000
  645.     PlaySound(Sounds.Shoot, true)
  646.     local effect = Part(Model, false, false, 0, 0, BN(ShootColors[MRA(1,#ShootColors)]), V3(0.2, 0.2, 0.2))
  647.     local effect2 = Part(Model, false, false, 0, 0, BN(ShootColors[MRA(1,#ShootColors)]), V3(0.2, 0.2, 0.2))
  648.     local m1 = Add.Mesh(effect, "http://www.roblox.com/asset/?id=20329976", V3(1,1,1))
  649.     local m2 = Add.Mesh(effect2, "http://www.roblox.com/asset/?id=20329976", V3(1,1,1))
  650.     local w1 = Weld(Main2, effect, CA(MR(-90), 0, 0), CN(0, -1, 0))
  651.     local w2 = Weld(Main2, effect2, CA(MR(-90), 0, 0), CN(0, -1, 0))
  652.     for i = 0, 1, 0.5 do
  653.         RAW.C0 = CA(MR(20-50*i), MR(50-25*i), MR(30+45*i))
  654.         LAW.C0 = CA(MR(50-10*i), 0, MR(30+20*i)) * CN(0, -0.6-0.3*i, 0)
  655.         RLW.C0 = CA(MR(30*i), 0, MR(-15*i))
  656.         LLW.C0 = CA(MR(10*i), 0, MR(-35*i))
  657.         FW.C0 = CA(MR(5*i), MR(-50-15*i), 0)
  658.         HW.C0 = CA(MR(30), MR(35*i), MR(-25*i))
  659.         Neck.C0 = necko * CA(MR(10*i), 0, 0)
  660.         bp.position = cf * CN(0, 0, 3*i).p
  661.         m1.Scale = V3(0.5+0.6*i, 0.4+0.2*i, 0.5+0.6*i)
  662.         m2.Scale = V3(0.3+0.5*i, 0.5+1*i, 0.3+0.5*i)
  663.         w1.C1 = CN(0, -1-0.2*i, 0)
  664.         w2.C1 = CN(0, -1-0.5*i, 0)
  665.         effect.Transparency = 0.2*i
  666.         effect2.Transparency = 0.2*i
  667.         wait()
  668.     end
  669.     for i = 0.2, 1, 0.2 do
  670.         RAW.C0 = CA(MR(-30-10*i), MR(25-5*i), MR(75+5*i))
  671.         LAW.C0 = CA(MR(40-5*i), 0, MR(50+5*i)) * CN(0, -0.9-0.05*i, 0)
  672.         RLW.C0 = CA(MR(30+5*i), 0, MR(-15))
  673.         LLW.C0 = CA(MR(10+5*i), 0, MR(-35-5*i))
  674.         FW.C0 = CA(MR(5+5*i), MR(-65-5*i), 0)
  675.         HW.C0 = CA(MR(30), MR(35+5*i), MR(-25-5*i))
  676.         Neck.C0 = necko * CA(MR(10+5*i), 0, 0)
  677.         bp.position = cf * CN(0, 0, 3+1*i).p
  678.         m1.Scale = V3(1+1*i, 0.7+0.9*i, 1+1*i)
  679.         m2.Scale = V3(0.8+0.6*i, 1.5+1.6*i, 0.8+0.6*i)
  680.         w1.C1 = CN(0, -1.2-0.6*i, 0)
  681.         w2.C1 = CN(0, -1.5-1.8*i, 0)
  682.         effect.Transparency = 0.2+0.9*i
  683.         effect2.Transparency = 0.2+0.9*i
  684.         wait()
  685.     end
  686.     effect:remove()
  687.     effect2:remove()
  688.     for i = 0.2, 1, 0.2 do
  689.         bp.position = cf * CN(0, 0, 4+0.8*i).p
  690.         wait()
  691.     end
  692.     for i = 0.08, 1, 0.06 do
  693.         RAW.C0 = CA(MR(-40+50*i), MR(20+15*i), MR(80-35*i))
  694.         LAW.C0 = CA(MR(35-30*i), 0, MR(55-45*i)) * CN(0, -0.95+0.5*i, 0)
  695.         RLW.C0 = CA(MR(35-35*i), 0, MR(-15+25*i))
  696.         LLW.C0 = CA(MR(15-15*i), 0, MR(-40+30*i))
  697.         FW.C0 = CA(MR(10-7*i), MR(-70+40*i), 0)
  698.         HW.C0 = CA(MR(30), MR(40-40*i), MR(-30-10*i))
  699.         Neck.C0 = necko * CA(MR(15+5*i), 0, MR(20*i))
  700.         bp.position = cf * CN(0, 0, 4.8+0.8*i).p
  701.         wait()
  702.     end
  703.     bp:remove()
  704.     for i = 0.33, 1, 0.33 do
  705.         RAW.C0 = CA(MR(10+10*i), MR(35+5*i), MR(45-5*i))
  706.         LAW.C0 = CA(MR(5), 0, MR(10)) * CN(0, -0.45+0.1*i, 0)
  707.         FW.C0 = CA(MR(3-3*i), MR(-30+5*i), 0)
  708.         HW.C0 = CA(MR(30), 0, MR(-40-10*i))
  709.         wait()
  710.     end
  711.     for i = 0.12, 1, 0.12 do
  712.         RAW.C0 = CA(MR(20+5*i), MR(40+5*i), MR(40+5*i))
  713.         LAW.C0 = CA(MR(5), 0, MR(10)) * CN(0, -0.35-0.3*i, 0)
  714.         FW.C0 = CA(0, MR(-25+5*i), 0)
  715.         HW.C0 = CA(MR(30), 0, MR(-50-5*i))
  716.         wait()
  717.     end
  718.     local b = Part(Model, false, false, 0, 0, BN("Black"), V3(1.1, 1.1, 1.1))
  719.     local m = Add.Sphere(b)
  720.     local w = Weld(Larm, b, CN(), CN(0, 1.4, 0))
  721.     for i = 0.16, 1, 0.16 do
  722.         LAW.C0 = CA(MR(5+30*i), 0, MR(10+10*i)) * CN(0, -0.65+0.65*i, 0)
  723.         RAW.C0 = CA(MR(25), MR(45+3*i), MR(40))
  724.         m.Scale = V3(0.5+0.5*i, 0.5+0.5*i, 0.5+0.5*i)
  725.         Neck.C0 = necko * CA(MR(20-10*i), 0, MR(20-15*i))
  726.         wait()
  727.     end
  728.     for i = 0.1, 1, 0.1 do
  729.         LAW.C0 = CA(MR(35+105*i), 0, MR(20+20*i)) * CN(0, -0.9*i, 0)
  730.         RAW.C0 = CA(MR(25), MR(48+6*i), MR(40))
  731.         Neck.C0 = necko * CA(MR(10-10*i), 0, MR(5-35*i))
  732.         wait()
  733.     end
  734.     for i = 0.16, 1, 0.16 do
  735.         LAW.C0 = CA(MR(140-10*i), 0, MR(40-15*i)) * CN(0, -0.9-0.2*i, 0)
  736.         RAW.C0 = CA(MR(25), MR(54), MR(40))
  737.         Neck.C0 = necko * CA(MR(5*i), 0, MR(-30))
  738.         w.C0 = CN(1.5*i, 0.55*i, 1.1*i)
  739.         wait()
  740.     end
  741.     PlaySound(Sounds.Reload, true)
  742.     b:remove()
  743.     w:remove()
  744.     for i = 0.2, 1, 0.2 do
  745.         LAW.C0 = CA(MR(130-10*i), 0, MR(25-15*i)) * CN(0, -1.1+0.2*i, 0)
  746.         RAW.C0 = CA(MR(25-10*i), MR(54), MR(40))
  747.         Neck.C0 = necko * CA(MR(5-3*i), 0, MR(-30+5*i))
  748.         HW.C0 = CA(MR(30), 0, MR(-55+10*i))
  749.         FW.C0 = CA(0, MR(-20-5*i), 0)
  750.         wait()
  751.     end
  752.     for i = 0.11, 1, 0.11 do
  753.         LAW.C0 = CA(MR(120-60*i), 0, MR(10+15*i)) * CN(0, -0.9+0.3*i, 0)
  754.         RAW.C0 = CA(MR(15+5*i), MR(54-4*i), MR(40-10*i))
  755.         Neck.C0 = necko * CA(MR(2-2*i), 0, MR(-25+25*i))
  756.         HW.C0 = CA(MR(30), 0, MR(-45+45*i))
  757.         FW.C0 = CA(0, MR(-25-20*i), 0)
  758.         RLW.C0 = CA(0, 0, MR(10-8*i))
  759.         LLW.C0 = CA(0, 0, MR(-10+8*i))
  760.         wait()
  761.     end
  762.     Neck.C0 = necko
  763.     for i = 0.25, 1, 0.25 do
  764.         LAW.C0 = CA(MR(60-10*i), 0, MR(25+5*i)) * CN(0, -0.6, 0)
  765.         RAW.C0 = CA(MR(20), MR(50), MR(30))
  766.         HW.C0 = CA(MR(30), 0, 0)
  767.         FW.C0 = CA(0, MR(-45-5*i), 0)
  768.         RLW.C0 = CA(0, 0, MR(2-2*i))
  769.         LLW.C0 = CA(0, 0, MR(-2+2*i))
  770.         wait()
  771.     end
  772.     RLW.Part1 = nil
  773.     LLW.Part1 = nil
  774.     RAW.C0 = CA(MR(20), MR(50), MR(30))
  775.     LAW.C0 = CA(MR(50), 0, MR(30)) * CN(0, -0.6, 0)
  776.     FW.C0 = CA(0, MR(-50), 0)
  777.     HW.C0 = CA(MR(30), 0, 0)
  778.     Neck.C0 = necko
  779. end
  780.  
  781. function Melee()
  782.     PlaySound(Sounds.Slash, true)
  783.     for i = 0.25, 1, 0.25 do
  784.         RAW.C0 = CA(MR(20+5*i), MR(50-5*i), MR(30+3*i))
  785.         LAW.C0 = CA(MR(50), 0, MR(30+4*i)) * CN(0, -0.6-0.05*i, 0)
  786.         HW.C0 = CA(MR(30), MR(5*i), 0)
  787.         FW.C0 = CA(0, MR(-50-5*i), 0)
  788.         wait()
  789.     end
  790.     for i = 0.12, 1, 0.12 do
  791.         RAW.C0 = CA(MR(25+25*i), MR(45-30*i), MR(33+7*i))
  792.         LAW.C0 = CA(MR(50), 0, MR(34+11*i)) * CN(0, -0.65-0.25*i, 0)
  793.         HW.C0 = CA(MR(30), MR(5+25*i), 0)
  794.         FW.C0 = CA(0, MR(-55-25*i), 0)
  795.         wait()
  796.     end
  797.     for i = 0.33, 1, 0.33 do
  798.         RAW.C0 = CA(MR(50+15*i), MR(15-5*i), MR(40-10*i)) * CN(0, -0.2*i, 0)
  799.         LAW.C0 = CA(MR(50+10*i), 0, MR(45-5*i)) * CN(0, -0.9+0.15*i, 0)
  800.         HW.C0 = CA(MR(30+2*i), MR(30+5*i), 0)
  801.         FW.C0 = CA(0, MR(-80+10*i), MR(-5*i))
  802.         wait()
  803.     end
  804.     Hurt = true
  805.     Debounce = true
  806.     for i = 0.07, 1, 0.07 do
  807.         RAW.C0 = CA(MR(65+55*i), MR(10), MR(30-70*i)) * CN(0, -0.2-1.1*i, 0)
  808.         LAW.C0 = CA(MR(60+120*i), 0, MR(40-70*i)) * CN(0, -0.75+0.7*i, 0)
  809.         HW.C0 = CA(MR(32+6*i), MR(35+20*i), MR(-4*i))
  810.         FW.C0 = CA(0, MR(-70+110*i), 0)
  811.         wait()
  812.     end
  813.     for i = 0.16, 1, 0.16 do
  814.         RAW.C0 = CA(MR(120+10*i), MR(10), MR(-40-5*i)) * CN(0, -1.3-0.1*i, 0)
  815.         LAW.C0 = CA(MR(180+15*i), 0, MR(-30-20*i)) * CN(0, -0.05+0.1*i, 0)
  816.         HW.C0 = CA(MR(38+2*i), MR(55-6*i), MR(-4-1*i))
  817.         FW.C0 = CA(0, MR(40+10*i), 0)
  818.         wait()
  819.     end
  820.     Hurt = false
  821.     for i = 0.2, 1, 0.2 do
  822.         RAW.C0 = CA(MR(130+5*i), MR(10), MR(-45-2*i)) * CN(0, -1.4-0.05*i, 0)
  823.         LAW.C0 = CA(MR(195+5*i), 0, MR(-50-8*i)) * CN(0, 0.05+0.05*i, 0)
  824.         HW.C0 = CA(MR(40), MR(49-2*i), MR(-5))
  825.         FW.C0 = CA(0, MR(50+3*i), 0)
  826.         wait()
  827.     end
  828.     wait(0.2)
  829.     for i = 0.2, 1, 0.2 do
  830.         RAW.C0 = CA(MR(135-10*i), MR(10+5*i), MR(-47+10*i)) * CN(0, -1.45+0.25*i, 0)
  831.         LAW.C0 = CA(MR(200-10*i), 0, MR(-58+10*i)) * CN(0, 0.1-0.1*i, 0)
  832.         HW.C0 = CA(MR(40), MR(47-5*i), MR(-5+5*i))
  833.         FW.C0 = CA(0, MR(53-10*i), 0)
  834.         wait()
  835.     end
  836.     for i = 0.08, 1, 0.08 do
  837.         RAW.C0 = CA(MR(125-90*i), MR(15+30*i), MR(-37+57*i)) * CN(0, -1.2+1.1*i, 0)
  838.         LAW.C0 = CA(MR(190-125*i), 0, MR(-48+68*i)) * CN(0, -0.5*i, 0)
  839.         HW.C0 = CA(MR(40-7*i), MR(42-37*i), 0)
  840.         FW.C0 = CA(0, MR(43-82*i), 0)
  841.         wait()
  842.     end
  843.     for i = 0.2, 1, 0.2 do
  844.         RAW.C0 = CA(MR(35-15*i), MR(45+5*i), MR(20+10*i)) * CN(0, -0.1+0.1*i, 0)
  845.         LAW.C0 = CA(MR(65-15*i), 0, MR(20+10*i)) * CN(0, -0.5-0.1*i, 0)
  846.         HW.C0 = CA(MR(33-3*i), MR(5-5*i), 0)
  847.         FW.C0 = CA(0, MR(-41-9*i), 0)
  848.         wait()
  849.     end
  850.     RLW.Part1 = nil
  851.     LLW.Part1 = nil
  852.     RAW.C0 = CA(MR(20), MR(50), MR(30))
  853.     LAW.C0 = CA(MR(50), 0, MR(30)) * CN(0, -0.6, 0)
  854.     FW.C0 = CA(0, MR(-50), 0)
  855.     HW.C0 = CA(MR(30), 0, 0)
  856.     Neck.C0 = necko
  857. end
  858.  
  859. function onSelected(mouse)
  860.     SelectAnim()
  861.     Selected = true
  862.     mouse.Button1Down:connect(function()
  863.         if Attacking == false then
  864.             Attacking = true
  865.             mouse.Button1Up:wait()
  866.             Shoot(mouse.Hit.p)
  867.             ShootAnim(mouse.Hit.p)
  868.             Attacking = false
  869.         end
  870.     end)
  871.     mouse.KeyDown:connect(function(key)
  872.         key = key:lower()
  873.         if key == "q" then
  874.             if Attacking == false then
  875.                 Attacking = true
  876.                 Melee()
  877.                 Attacking = false
  878.             end
  879.         end
  880.     end)
  881. end
  882.  
  883. function onDeselected(mouse)
  884.     Selected = false
  885.     DeselAnim()
  886. end
  887.  
  888. bin.Selected:connect(onSelected)
  889. bin.Deselected:connect(onDeselected)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement