Advertisement
PegarTodos

FE 3

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