Advertisement
samuelrichter66

gun x III

May 29th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 73.65 KB | None | 0 0
  1. --https://github.com/Mokiros/roblox-FE-compatibility
  2. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  3. local Player,game,owner = owner,game
  4. local RealPlayer = Player
  5. do
  6. print("FE Compatibility code V2 by Mokiros")
  7. local RealPlayer = RealPlayer
  8. script.Parent = RealPlayer.Character
  9.  
  10. --Fake event to make stuff like Mouse.KeyDown work
  11. local Disconnect_Function = function(this)
  12. this[1].Functions[this[2]] = nil
  13. end
  14. local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
  15. local FakeEvent_Metatable = {__index={
  16. Connect = function(this,f)
  17. local i = tostring(math.random(0,10000))
  18. while this.Functions[i] do
  19. i = tostring(math.random(0,10000))
  20. end
  21. this.Functions[i] = f
  22. return setmetatable({this,i},Disconnect_Metatable)
  23. end
  24. }}
  25. FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
  26. local function fakeEvent()
  27. return setmetatable({Functions={}},FakeEvent_Metatable)
  28. end
  29.  
  30. --Creating fake input objects with fake variables
  31. local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  32. FakeMouse.keyUp = FakeMouse.KeyUp
  33. FakeMouse.keyDown = FakeMouse.KeyDown
  34. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  35. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  36. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  37. end}
  38. --Merged 2 functions into one by checking amount of arguments
  39. CAS.UnbindAction = CAS.BindAction
  40.  
  41. --This function will trigger the events that have been :Connect()'ed
  42. local function TriggerEvent(self,ev,...)
  43. for _,f in pairs(self[ev].Functions) do
  44. f(...)
  45. end
  46. end
  47. FakeMouse.TriggerEvent = TriggerEvent
  48. UIS.TriggerEvent = TriggerEvent
  49.  
  50. --Client communication
  51. local Event = Instance.new("RemoteEvent")
  52. Event.Name = "UserInput_Event"
  53. Event.OnServerEvent:Connect(function(plr,io)
  54. if plr~=RealPlayer then return end
  55. FakeMouse.Target = io.Target
  56. FakeMouse.Hit = io.Hit
  57. if not io.isMouse then
  58. local b = io.UserInputState == Enum.UserInputState.Begin
  59. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  60. return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
  61. end
  62. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  63. return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
  64. end
  65. for _,t in pairs(CAS.Actions) do
  66. for _,k in pairs(t.Keys) do
  67. if k==io.KeyCode then
  68. t.Function(t.Name,io.UserInputState,io)
  69. end
  70. end
  71. end
  72. FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  73. UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
  74. end
  75. end)
  76. Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
  77. local Mouse = owner:GetMouse()
  78. local UIS = game:GetService("UserInputService")
  79. local input = function(io,RobloxHandled)
  80. if RobloxHandled then return end
  81. --Since InputObject is a client-side instance, we create and pass table instead
  82. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  83. end
  84. UIS.InputBegan:Connect(input)
  85. UIS.InputEnded:Connect(input)
  86.  
  87. local h,t
  88. --Give the server mouse data every second frame, but only if the values changed
  89. --If player is not moving their mouse, client won't fire events
  90. local HB = game:GetService("RunService").Heartbeat
  91. while true do
  92. if h~=Mouse.Hit or t~=Mouse.Target then
  93. h,t=Mouse.Hit,Mouse.Target
  94. Event:FireServer({isMouse=true,Target=t,Hit=h})
  95. end
  96. --Wait 2 frames
  97. for i=1,2 do
  98. HB:Wait()
  99. end
  100. end]==],script)
  101.  
  102. ----Sandboxed game object that allows the usage of client-side methods and services
  103. --Real game object
  104. local RealGame = game
  105.  
  106. --Metatable for fake service
  107. local FakeService_Metatable = {
  108. __index = function(self,k)
  109. local s = rawget(self,"_RealService")
  110. if s then
  111. return typeof(s[k])=="function"
  112. and function(_,...)return s[k](s,...)end or s[k]
  113. end
  114. end,
  115. __newindex = function(self,k,v)
  116. local s = rawget(self,"_RealService")
  117. if s then s[k]=v end
  118. end
  119. }
  120. local function FakeService(t,RealService)
  121. t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
  122. return setmetatable(t,FakeService_Metatable)
  123. end
  124.  
  125. --Fake game object
  126. local FakeGame = {
  127. GetService = function(self,s)
  128. return rawget(self,s) or RealGame:GetService(s)
  129. end,
  130. Players = FakeService({
  131. LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
  132. },"Players"),
  133. UserInputService = FakeService(UIS,"UserInputService"),
  134. ContextActionService = FakeService(CAS,"ContextActionService"),
  135. RunService = FakeService({
  136. _btrs = {},
  137. RenderStepped = RealGame:GetService("RunService").Heartbeat,
  138. BindToRenderStep = function(self,name,_,fun)
  139. self._btrs[name] = self.Heartbeat:Connect(fun)
  140. end,
  141. UnbindFromRenderStep = function(self,name)
  142. self._btrs[name]:Disconnect()
  143. end,
  144. },"RunService")
  145. }
  146. rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
  147. FakeGame.service = FakeGame.GetService
  148. FakeService(FakeGame,game)
  149. --Changing owner to fake player object to support owner:GetMouse()
  150. game,owner = FakeGame,FakeGame.Players.LocalPlayer
  151. end
  152.  
  153.  
  154.  
  155. Player = game.Players.LocalPlayer
  156. Character = Player.Character
  157. PlayerGui = Player.PlayerGui
  158. Backpack = Player.Backpack
  159. Torso = Character.Torso
  160. Head = Character.Head
  161. Humanoid = Character.Humanoid
  162. LeftArm = Character["Left Arm"]
  163. LeftLeg = Character["Left Leg"]
  164. RightArm = Character["Right Arm"]
  165. RightLeg = Character["Right Leg"]
  166. PlayerGui = Player.PlayerGui
  167. Backpack = Player.Backpack
  168. Torso = Character.Torso
  169. Head = Character.Head
  170. Humanoid = Character.Humanoid
  171. LeftArm = Character["Left Arm"]
  172. LeftLeg = Character["Left Leg"]
  173. RightArm = Character["Right Arm"]
  174. RightLeg = Character["Right Leg"]
  175. LS = Torso["Left Shoulder"]
  176. RS = Torso["Right Shoulder"]
  177. Neck = Torso.Neck
  178. attacktype = 1
  179. vt = Vector3.new
  180. cf = CFrame.new
  181. euler = CFrame.fromEulerAnglesXYZ
  182. angles = CFrame.Angles
  183. necko = cf(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  184. necko2 = cf(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  185. LHC0 = cf(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  186. LHC1 = cf(-0.5, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  187. RHC0 = cf(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  188. RHC1 = cf(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  189. RootPart = Character.HumanoidRootPart
  190. RootJoint = RootPart.RootJoint
  191. RootCF = euler(-1.57, 0, 3.14)
  192. attack = false
  193. equipped = false
  194. local Anim = "Idle"
  195. local Effects = {}
  196. cam = workspace.CurrentCamera
  197. ZTarget = nil
  198. RocketTarget = nil
  199. local RbxUtility = LoadLibrary("RbxUtility")
  200. local Create = RbxUtility.Create
  201. local m = Create("Model"){
  202. Parent = Character,
  203. Name = "WeaponModel",
  204. }
  205. mouse = Player:GetMouse()
  206. RSH = Torso["Right Shoulder"]
  207. LSH = Torso["Left Shoulder"]
  208. RHP = Character.Torso["Right Hip"]
  209. LHP = Character.Torso["Left Hip"]
  210.  
  211. function NoOutline(Part)
  212. Part.TopSurface, Part.BottomSurface, Part.LeftSurface, Part.RightSurface, Part.FrontSurface, Part.BackSurface = 10, 10, 10, 10, 10, 10
  213. end
  214. function swait(num)
  215. if num == 0 or num == nil then
  216. game:service'RunService'.Heartbeat:wait()
  217. else
  218. for i = 0, num do
  219. game:service'RunService'.Heartbeat:wait()
  220. end
  221. end
  222. end
  223.  
  224. function nooutline(part)
  225. part.TopSurface, part.BottomSurface, part.LeftSurface, part.RightSurface, part.FrontSurface, part.BackSurface = 10, 10, 10, 10, 10, 10
  226. end
  227.  
  228. function part(formfactor, parent, material, reflectance, transparency, brickcolor, name, size)
  229. local fp = Create("Part"){
  230. formFactor = formfactor,
  231. Parent = parent,
  232. Reflectance = reflectance,
  233. Transparency = transparency,
  234. CanCollide = false,
  235. Locked = true,
  236. BrickColor = BrickColor.new(tostring(brickcolor)),
  237. Name = name,
  238. Size = size,
  239. Position = Character.Torso.Position,
  240. Material = material,
  241. }
  242. nooutline(fp)
  243. return fp
  244. end
  245.  
  246. function mesh(Mesh, part, meshtype, meshid, offset, scale)
  247. local Msh = Create(Mesh){
  248. Parent = part,
  249. Offset = offset,
  250. Scale = scale,
  251. }
  252. if Mesh == "SpecialMesh" then
  253. Msh.MeshType = meshtype
  254. Msh.MeshId = meshid
  255. end
  256. return Msh
  257. end
  258.  
  259. function weld(parent, part0, part1, c0, c1)
  260. local Weld = Create("Weld"){
  261. Parent = parent,
  262. Part0 = part0,
  263. Part1 = part1,
  264. C0 = c0,
  265. C1 = c1,
  266. }
  267. return Weld
  268. end
  269.  
  270.  
  271. local function CFrameFromTopBack(at, top, back)
  272. local right = top:Cross(back)
  273. return CFrame.new(at.x, at.y, at.z,
  274. right.x, top.x, back.x,
  275. right.y, top.y, back.y,
  276. right.z, top.z, back.z)
  277. end
  278.  
  279. function Triangle(a, b, c)
  280. local edg1 = (c - a):Dot((b - a).unit)
  281. local edg2 = (a - b):Dot((c - b).unit)
  282. local edg3 = (b - c):Dot((a - c).unit)
  283. if edg1 <= (b - a).magnitude and edg1 >= 0 then
  284. a, b, c = a, b, c
  285. elseif edg2 <= (c - b).magnitude and edg2 >= 0 then
  286. a, b, c = b, c, a
  287. elseif edg3 <= (a - c).magnitude and edg3 >= 0 then
  288. a, b, c = c, a, b
  289. else
  290. assert(false, "unreachable")
  291. end
  292.  
  293. local len1 = (c - a):Dot((b - a).unit)
  294. local len2 = (b - a).magnitude - len1
  295. local width = (a + (b - a).unit * len1 - c).magnitude
  296.  
  297. local maincf = CFrameFromTopBack(a, (b - a):Cross(c - b).unit, -(b - a).unit)
  298.  
  299. local list = {}
  300.  
  301. local Color = BrickColor.new("Dark stone grey")
  302.  
  303. if len1 > 0.01 then
  304. local w1 = Create('WedgePart', m){
  305. Material = "SmoothPlastic",
  306. FormFactor = 'Custom',
  307. BrickColor = Color,
  308. Transparency = 0,
  309. Reflectance = 0,
  310. Material = "SmoothPlastic",
  311. CanCollide = false,
  312. Anchored = true,
  313. Parent = workspace,
  314. Transparency = 0.3,
  315. }
  316. game:GetService("Debris"):AddItem(w1, 5)
  317. NoOutline(w1)
  318. local sz = Vector3.new(0.2, width, len1)
  319. w1.Size = sz
  320. local sp = Create("SpecialMesh"){
  321. Parent = w1,
  322. MeshType = "Wedge",
  323. Scale = Vector3.new(0, 1, 1) * sz / w1.Size,
  324. }
  325. w1:BreakJoints()
  326. table.insert(Effects, {
  327. w1,
  328. "Disappear",
  329. .03
  330. })
  331. w1.CFrame = maincf * CFrame.Angles(math.pi, 0, math.pi / 2) * CFrame.new(0, width / 2, len1 / 2)
  332. table.insert(list, w1)
  333. end
  334. if len2 > 0.01 then
  335. local w2 = Create('WedgePart', m){
  336. Material = "SmoothPlastic",
  337. FormFactor = 'Custom',
  338. BrickColor = Color,
  339. Transparency = 0,
  340. Reflectance = 0,
  341. Material = "SmoothPlastic",
  342. CanCollide = false,
  343. Anchored = true,
  344. Parent = workspace,
  345. Transparency = 0.3,
  346. }
  347. game:GetService("Debris"):AddItem(w2, 5)
  348. NoOutline(w2)
  349. local sz = Vector3.new(0.2, width, len2)
  350. w2.Size = sz
  351. local sp = Create("SpecialMesh"){
  352. Parent = w2,
  353. MeshType = "Wedge",
  354. Scale = Vector3.new(0, 1, 1) * sz / w2.Size,
  355. }
  356. w2:BreakJoints()
  357. table.insert(Effects, {
  358. w2,
  359. "Disappear",
  360. .03
  361. })
  362. w2.CFrame = maincf * CFrame.Angles(math.pi, math.pi, -math.pi / 2) * CFrame.new(0, width / 2, -len1 - len2 / 2)
  363. table.insert(list, w2)
  364. end
  365. return unpack(list)
  366. end
  367.  
  368. function so(id, par, vol, pit)
  369. coroutine.resume(coroutine.create(function()
  370. local sou = Instance.new("Sound", par or workspace)
  371. sou.Volume = vol
  372. sou.Pitch = pit or 1
  373. sou.SoundId = id
  374. swait()
  375. sou:play()
  376. swait(6)
  377. sou:Remove()
  378. end))
  379. end
  380.  
  381. function clerp(a, b, t)
  382.  
  383. local function QuaternionFromCFrame(cf)
  384. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  385. local trace = m00 + m11 + m22
  386. if trace > 0 then
  387. local s = math.sqrt(1 + trace)
  388. local recip = 0.5 / s
  389. return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5
  390. else
  391. local i = 0
  392. if m11 > m00 then
  393. i = 1
  394. end
  395. if m22 > (i == 0 and m00 or m11) then
  396. i = 2
  397. end
  398. if i == 0 then
  399. local s = math.sqrt(m00 - m11 - m22 + 1)
  400. local recip = 0.5 / s
  401. return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip
  402. elseif i == 1 then
  403. local s = math.sqrt(m11 - m22 - m00 + 1)
  404. local recip = 0.5 / s
  405. return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip
  406. elseif i == 2 then
  407. local s = math.sqrt(m22 - m00 - m11 + 1)
  408. local recip = 0.5 / s
  409. return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip
  410. end
  411. end
  412. end
  413.  
  414. local function QuaternionToCFrame(px, py, pz, x, y, z, w)
  415. local xs, ys, zs = x + x, y + y, z + z
  416. local wx, wy, wz = w * xs, w * ys, w * zs
  417. local xx = x * xs
  418. local xy = x * ys
  419. local xz = x * zs
  420. local yy = y * ys
  421. local yz = y * zs
  422. local zz = z * zs
  423. return CFrame.new(px, py, pz, 1 - (yy + zz), xy - wz, xz + wy, xy + wz, 1 - (xx + zz), yz - wx, xz - wy, yz + wx, 1 - (xx + yy))
  424. end
  425.  
  426. local function QuaternionSlerp(a, b, t)
  427. local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4]
  428. local startInterp, finishInterp;
  429. if cosTheta >= 0.0001 then
  430. if (1 - cosTheta) > 0.0001 then
  431. local theta = math.acos(cosTheta)
  432. local invSinTheta = 1 / math.sin(theta)
  433. startInterp = math.sin((1 - t) * theta) * invSinTheta
  434. finishInterp = math.sin(t * theta) * invSinTheta
  435. else
  436. startInterp = 1 - t
  437. finishInterp = t
  438. end
  439. else
  440. if (1 + cosTheta) > 0.0001 then
  441. local theta = math.acos(-cosTheta)
  442. local invSinTheta = 1 / math.sin(theta)
  443. startInterp = math.sin((t - 1) * theta) * invSinTheta
  444. finishInterp = math.sin(t * theta) * invSinTheta
  445. else
  446. startInterp = t - 1
  447. finishInterp = t
  448. end
  449. end
  450. return a[1] * startInterp + b[1] * finishInterp, a[2] * startInterp + b[2] * finishInterp, a[3] * startInterp + b[3] * finishInterp, a[4] * startInterp + b[4] * finishInterp
  451. end
  452.  
  453. local qa = {
  454. QuaternionFromCFrame(a)
  455. }
  456. local qb = {
  457. QuaternionFromCFrame(b)
  458. }
  459. local ax, ay, az = a.x, a.y, a.z
  460. local bx, by, bz = b.x, b.y, b.z
  461.  
  462. local _t = 1 - t
  463. return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t))
  464. end
  465.  
  466. function rayCast(Pos, Dir, Max, Ignore)
  467. return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
  468. end
  469.  
  470. Damagefunc = function(Part, hit, minim, maxim, knockback, Type, Property, Delay, HitSound, HitPitch)
  471. if hit.Parent == nil then
  472. return
  473. end
  474. local h = hit.Parent:FindFirstChild("Humanoid")
  475. for _, v in pairs(hit.Parent:children()) do
  476. if v:IsA("Humanoid") then
  477. h = v
  478. end
  479. end
  480. if h ~= nil and hit.Parent.Name ~= Character.Name and hit.Parent:FindFirstChild("Torso") ~= nil then
  481. if hit.Parent:findFirstChild("DebounceHit") ~= nil then
  482. if hit.Parent.DebounceHit.Value == true then
  483. return
  484. end
  485. end
  486. if h.MaxHealth >= math.huge then
  487. hit:BreakJoints()
  488. end
  489. local c = Create("ObjectValue"){
  490. Name = "creator",
  491. Value = game:service("Players").LocalPlayer,
  492. Parent = h,
  493. }
  494. game:GetService("Debris"):AddItem(c, .5)
  495. if HitSound ~= nil and HitPitch ~= nil then
  496. so(HitSound, hit, 1, HitPitch)
  497. end
  498. local Damage = math.random(minim, maxim)
  499. local blocked = false
  500. local block = hit.Parent:findFirstChild("Block")
  501. if block ~= nil then
  502. if block.className == "IntValue" then
  503. if block.Value > 0 then
  504. blocked = true
  505. block.Value = block.Value - 1
  506. print(block.Value)
  507. end
  508. end
  509. end
  510. if blocked == false then
  511. h.Health = h.Health - Damage
  512. ShowDamage((Part.CFrame * CFrame.new(0, 0, (Part.Size.Z / 2)).p + Vector3.new(0, 1.5, 0)), -Damage, 1.5, Part.BrickColor.Color, Handle.BrickColor.Color)
  513. else
  514. h.Health = h.Health - (Damage / 2)
  515. ShowDamage((Part.CFrame * CFrame.new(0, 0, (Part.Size.Z / 2)).p + Vector3.new(0, 1.5, 0)), -Damage, 1.5, Part.BrickColor.Color, Handle.BrickColor.Color)
  516. end
  517. if Type == "Knockdown" then
  518. local hum = hit.Parent.Humanoid
  519. hum.PlatformStand = true
  520. coroutine.resume(coroutine.create(function(HHumanoid)
  521. swait(1)
  522. HHumanoid.PlatformStand = false
  523. end), hum)
  524. local angle = (hit.Position - (Property.Position + Vector3.new(0, 0, 0))).unit
  525. local bodvol = Create("BodyVelocity"){
  526. velocity = angle * knockback,
  527. P = 5000,
  528. maxForce = Vector3.new(8e+003, 8e+003, 8e+003),
  529. Parent = hit,
  530. }
  531. local rl = Create("BodyAngularVelocity"){
  532. P = 3000,
  533. maxTorque = Vector3.new(500000, 500000, 500000) * 50000000000000,
  534. angularvelocity = Vector3.new(math.random(-10, 10), math.random(-10, 10), math.random(-10, 10)),
  535. Parent = hit,
  536. }
  537. game:GetService("Debris"):AddItem(bodvol, .5)
  538. game:GetService("Debris"):AddItem(rl, .5)
  539. elseif Type == "Normal" then
  540. local vp = Create("BodyVelocity"){
  541. P = 500,
  542. maxForce = Vector3.new(math.huge, 0, math.huge),
  543. velocity = Property.CFrame.lookVector * knockback + Property.Velocity / 1.05,
  544. }
  545. if knockback > 0 then
  546. vp.Parent = hit.Parent.Torso
  547. end
  548. game:GetService("Debris"):AddItem(vp, .5)
  549. elseif Type == "Up" then
  550. local bodyVelocity = Create("BodyVelocity"){
  551. velocity = vt(0, 20, 0),
  552. P = 5000,
  553. maxForce = Vector3.new(8e+003, 8e+003, 8e+003),
  554. Parent = hit,
  555. }
  556. game:GetService("Debris"):AddItem(bodyVelocity, .5)
  557. elseif Type == "Snare" then
  558. local bp = Create("BodyPosition"){
  559. P = 2000,
  560. D = 100,
  561. maxForce = Vector3.new(math.huge, math.huge, math.huge),
  562. position = hit.Parent.Torso.Position,
  563. Parent = hit.Parent.Torso,
  564. }
  565. game:GetService("Debris"):AddItem(bp, 1)
  566. elseif Type == "Freeze" then
  567. local BodPos = Create("BodyPosition"){
  568. P = 50000,
  569. D = 1000,
  570. maxForce = Vector3.new(math.huge, math.huge, math.huge),
  571. position = hit.Parent.Torso.Position,
  572. Parent = hit.Parent.Torso,
  573. }
  574. local BodGy = Create("BodyGyro") {
  575. maxTorque = Vector3.new(4e+005, 4e+005, 4e+005) * math.huge ,
  576. P = 20e+003,
  577. Parent = hit.Parent.Torso,
  578. cframe = hit.Parent.Torso.CFrame,
  579. }
  580. hit.Parent.Torso.Anchored = true
  581. coroutine.resume(coroutine.create(function(Part)
  582. swait(1.5)
  583. Part.Anchored = false
  584. end), hit.Parent.Torso)
  585. game:GetService("Debris"):AddItem(BodPos, 3)
  586. game:GetService("Debris"):AddItem(BodGy, 3)
  587. end
  588. local debounce = Create("BoolValue"){
  589. Name = "DebounceHit",
  590. Parent = hit.Parent,
  591. Value = true,
  592. }
  593. game:GetService("Debris"):AddItem(debounce, Delay)
  594. c = Instance.new("ObjectValue")
  595. c.Name = "creator"
  596. c.Value = Player
  597. c.Parent = h
  598. game:GetService("Debris"):AddItem(c, .5)
  599. end
  600. end
  601.  
  602. function ShowDamage(Pos, Text, Time, Color, Color2)
  603. local Rate = (1 / 30)
  604. local Pos = (Pos or Vector3.new(0, 0, 0))
  605. local Text = (Text or "")
  606. local Time = (Time or 2)
  607. local Color = (Color or Color3.new(1, 0, 0))
  608. local EffectPart = part("Custom", workspace, "SmoothPlastic", 0, 1, BrickColor.new(Color), "Effect", vt(0, 0, 0))
  609. EffectPart.Anchored = true
  610. local BillboardGui = Create("BillboardGui"){
  611. Size = UDim2.new(3, 0, 3, 0),
  612. Adornee = EffectPart,
  613. Parent = EffectPart,
  614. }
  615. local TextLabel = Create("TextLabel"){
  616. BackgroundTransparency = 1,
  617. Size = UDim2.new(1, 0, 1, 0),
  618. Text = Text,
  619. TextColor3 = Color,
  620. TextScaled = true,
  621. Font = Enum.Font.ArialBold,
  622. FontSize = Enum.FontSize.Size10,
  623. TextStrokeColor3 = Color2,
  624. TextStrokeTransparency = 0.8,
  625. Parent = BillboardGui,
  626. }
  627. game.Debris:AddItem(EffectPart, (Time + 0.1))
  628. EffectPart.Parent = game:GetService("Workspace")
  629. delay(0, function()
  630. local Frames = (Time / Rate)
  631. for Frame = 1, Frames do
  632. wait(Rate)
  633. local Percent = (Frame / Frames)
  634. EffectPart.CFrame = CFrame.new(Pos) + Vector3.new(0, Percent, 0)
  635. TextLabel.TextTransparency = Percent
  636. end
  637. if EffectPart and EffectPart.Parent then
  638. EffectPart:Destroy()
  639. end
  640. end)
  641. end
  642.  
  643. Handle=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Handle",Vector3.new(0.280000031, 0.699999988, 0.280000001))
  644. Handleweld=weld(m,Character["Right Arm"],Handle,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.0860519409, -0.159469604, 1.00696373, 1, -1.72803976e-011, 1.90765604e-006, 1.90764786e-006, 4.44081707e-006, -1, 9.09494702e-012, 0.999999881, 4.44081707e-006))
  645. FakeHandle=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","FakeHandle",Vector3.new(0.280000031, 0.699999988, 0.280000001))
  646. FakeHandleweld=weld(m,Handle,FakeHandle,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-1.90734863e-006, 0.0707168579, 0.0574593544, 1, -8.18545232e-012, 2.86099269e-013, -8.18545232e-012, 1, 4.54747351e-013, 2.86099269e-013, 4.54747351e-013, 1))
  647. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.200000003, 0.200000003))
  648. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.000375747681, -1.18781972, 0.839702606, -1, -1.02313925e-006, -2.56240446e-006, 2.56240173e-006, 1.79690323e-006, -1, 1.02317256e-006, -1, -1.79690414e-006))
  649. mesh("SpecialMesh",Part,Enum.MeshType.Wedge,"",Vector3.new(0, 0, 0),Vector3.new(0.699999988, 0.699999988, 0.699999988))
  650. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.200000003, 0.420000017, 0.200000003))
  651. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.889633477, -0.979663849, 0.0548973083, -0.258811921, -5.54403186e-006, -0.96592772, -3.15453076e-006, 1, -4.89435752e-006, 0.96592778, 1.78029984e-006, -0.258811951))
  652. mesh("SpecialMesh",Part,Enum.MeshType.FileMesh,"http://www.roblox.com/asset/?id=111896510",Vector3.new(0, 0, 0),Vector3.new(0.349999994, 0.349999994, 0.349999994))
  653. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.200000003, 0.200000003, 0.280000001))
  654. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.279872894, 0.209986687, -1.33514404e-005, -3.935309e-006, 1, -2.90573007e-006, 1.08481819e-008, 2.90573598e-006, 1, 1, 3.93527625e-006, -1.08583693e-008))
  655. mesh("SpecialMesh",Part,Enum.MeshType.FileMesh,"http://www.roblox.com/asset/?id=3270017",Vector3.new(0, 0, 0),Vector3.new(0.519399941, 0.557200074, 1.74439991))
  656. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.200000003, 0.420000017, 0.200000003))
  657. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.889616966, -0.979663849, -0.0549716949, 0.258811742, -5.84206009e-006, -0.96592778, -1.50227504e-006, 1, -6.45063938e-006, 0.965927839, 3.12056136e-006, 0.258811772))
  658. mesh("SpecialMesh",Part,Enum.MeshType.FileMesh,"http://www.roblox.com/asset/?id=111896510",Vector3.new(0, 0, 0),Vector3.new(0.349999994, 0.349999994, 0.349999994))
  659. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.420000046, 0.280000061, 0.560000002))
  660. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.419868469, 7.62939453e-006, 2.7179718e-005, 3.83001225e-006, -1, 2.54809993e-006, 1, 3.82997496e-006, 3.03872399e-010, -3.12454534e-010, 2.54810584e-006, 1))
  661. mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1))
  662. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.280000031, 0.700000048, 0.280000001))
  663. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-1.14440918e-005, 0.552843094, 0.296955109, 1, -2.22826202e-011, 1.80189787e-011, -7.95807864e-013, 0.707115233, -0.707098365, -1.73940862e-011, 0.707098365, 0.707115233))
  664. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.420000046, 0.28700006, 0.280000031))
  665. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.41986084, 0.00234603882, 2.14576721e-005, 3.74060505e-006, -1, 2.30967612e-006, 1, 3.74057413e-006, -7.42010826e-008, 7.41938067e-008, 2.30968203e-006, 1))
  666. mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1))
  667. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.287, 0.560000062, 0.200000003))
  668. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.00273132324, 0.622810364, 0.296985626, 1, -2.22826202e-011, 1.80189787e-011, -7.95807864e-013, 0.707115233, -0.707098365, -1.73940862e-011, 0.707098365, 0.707115233))
  669. mesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 0.699999988))
  670. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.420000046, 0.280000061, 0.420000017))
  671. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.839817047, -1.90734863e-005, -0.489821672, 3.8300077e-006, -1, 2.53319945e-006, 1, 3.82997496e-006, 3.04327147e-010, -3.12426113e-010, 2.53320582e-006, 1))
  672. mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1))
  673. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.420000046, 0.28700006, 0.280000031))
  674. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.839794159, 0.00254631042, -0.49509263, 3.8300077e-006, -1, 2.53319945e-006, 1, 3.82997496e-006, 3.04327147e-010, -3.12426113e-010, 2.53320582e-006, 1))
  675. mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1))
  676. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.280000031, 0.420000046, 0.980000079))
  677. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(1.90734863e-006, -0.559818268, 0.0699512959, 1, -2.04636308e-011, 7.38572398e-013, -1.63709046e-011, 1, 2.6823227e-007, 7.82044568e-013, -2.68225904e-007, 1))
  678. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.200000003, 0.280000001))
  679. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.279872894, 0.209986687, -1.33514404e-005, -3.935309e-006, 1, -2.90573007e-006, 1.08481819e-008, 2.90573598e-006, 1, 1, 3.93527625e-006, -1.08583693e-008))
  680. mesh("SpecialMesh",Part,Enum.MeshType.FileMesh,"http://www.roblox.com/asset/?id=3270017",Vector3.new(0, 0, 0),Vector3.new(0.491399914, 0.557200074, 1.74439991))
  681. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.280000031, 0.200000003, 0.560000062))
  682. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-2.0980835e-005, -0.419818878, 0.839810848, 1, -2.13731255e-011, -1.65118821e-011, -1.54614099e-011, 1, 2.62222466e-006, 1.80325338e-011, -2.62221829e-006, 1))
  683. mesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.699999988, 1))
  684. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.420000017, 0.420000017, 0.560000002))
  685. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.559810638, -0.769824028, -3.43322754e-005, 1.45437184e-007, -1, -1.29630371e-006, -2.08639904e-007, 1.29629734e-006, -1, 1, 1.45400691e-007, -2.08638184e-007))
  686. mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1))
  687. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.280000061, 0.280000061, 0.280000031))
  688. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.209846497, -3.81469727e-006, 0.559957266, 1.49184416e-008, -1, -6.10877123e-007, 1, 1.48816071e-008, 2.96593194e-010, -2.95063474e-010, -6.10870757e-007, 1))
  689. mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1))
  690. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.287, 0.840000033, 0.200000003))
  691. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.00215530396, -0.0698623657, 0.000190734863, 1, -2.22826202e-011, 1.80189787e-011, -1.43245416e-011, 1, 2.69661223e-006, -1.68107646e-011, -2.69660586e-006, 1))
  692. mesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 0.699999988))
  693. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.287, 0.200000003, 0.560000002))
  694. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.0021572113, -0.559833527, -0.0698022842, 1, -5.50244295e-011, 1.91965506e-011, -4.70663508e-011, 1, 2.69661314e-006, -1.56331059e-011, -2.69659495e-006, 1))
  695. mesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.699999988, 1))
  696. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.287, 0.427000016, 0.200000003))
  697. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.000122070313, -0.560840607, 0.27643466, 1, -2.22826202e-011, 1.80189787e-011, -1.43245416e-011, 1, 8.19589786e-007, -1.68107889e-011, -8.1958342e-007, 1))
  698. mesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 0.699999988))
  699. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.420000017, 0.420000017, 0.280000031))
  700. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.55978775, -2.44724131, -0.000165939331, 1.45490276e-007, -1, -2.49798723e-005, -2.08999595e-007, 2.49798668e-005, -1, 1, 1.45458671e-007, -2.08994436e-007))
  701. mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1))
  702. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.420000017, 0.280000001, 0.560000062))
  703. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.559822083, 0, -0.419999123, 5.95878191e-008, 1, 1.94764652e-007, -1, 5.9624881e-008, 3.44258311e-008, 3.44273339e-008, -1.94758286e-007, 1))
  704. mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1))
  705. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.280000031, 0.200000003, 0.200000003))
  706. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0, 0.279838562, 0.21000886, 1, 4.46839294e-008, 1.44186561e-006, 4.47196271e-008, -1, 7.78919912e-007, 1.44186413e-006, -7.78926278e-007, -1))
  707. mesh("SpecialMesh",Part,Enum.MeshType.Wedge,"",Vector3.new(0, 0, 0),Vector3.new(1, 0.699999988, 0.699999988))
  708. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.420000017, 0.560000002, 0.420000017))
  709. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.559791565, -0.55984664, 3.81469727e-005, 1.4543707e-007, -1, -5.08004541e-006, -2.08696321e-007, 5.08003723e-006, -1, 1, 1.45401373e-007, -2.08694047e-007))
  710. mesh("SpecialMesh",Part,Enum.MeshType.Sphere,"",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1))
  711. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.280000031, 0.200000003, 0.200000003))
  712. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(5.91278076e-005, 0.279800415, 1.04951167, -1, -2.53198436e-007, 1.49545034e-008, 2.53235044e-007, -1, -7.584179e-006, 1.49579638e-008, -7.58417036e-006, 1))
  713. mesh("SpecialMesh",Part,Enum.MeshType.Wedge,"",Vector3.new(0, 0, 0),Vector3.new(1, 0.699999988, 0.699999988))
  714. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.420000017, 0.560000062, 0.200000003))
  715. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.559768677, -2.37841272, -0.000438690186, 1.45475724e-007, -1, -2.01288749e-005, -2.08974669e-007, 2.01288676e-005, -1, 1, 1.45443096e-007, -2.08970206e-007))
  716. mesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 0.699999988))
  717. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.420000017, 0.280000001, 0.420000017))
  718. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.55979538, -0.979748011, 7.62939453e-006, 1.45442073e-007, -1, -6.30070645e-006, -2.08722611e-007, 6.30070008e-006, -1, 1, 1.45406489e-007, -2.08720166e-007))
  719. mesh("SpecialMesh",Part,Enum.MeshType.Sphere,"",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1))
  720. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.280000031, 0.200000003, 0.560000002))
  721. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(1.90734863e-006, -0.27980423, 0.699883938, 1, -2.04636308e-011, 1.10889423e-012, -1.63709046e-011, 1, 2.11572933e-006, 4.11753964e-013, -2.11572296e-006, 1))
  722. mesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.699999988, 1))
  723. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.280000031, 0.200000003, 0.560000062))
  724. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-3.24249268e-005, -0.699771881, 0.839804649, 1, -2.13731255e-011, -1.66693187e-011, -1.54614099e-011, 1, 4.23093024e-006, 1.81899929e-011, -4.23092433e-006, 1))
  725. mesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.699999988, 1))
  726. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.280000031, 0.200000003, 0.200000003))
  727. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-4.76837158e-005, -0.559803009, 1.0495255, 1, -1.56887836e-011, 3.45319641e-011, -2.09183781e-011, 1, 5.48155458e-006, -3.30136751e-011, -5.48154867e-006, 1))
  728. mesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.699999988, 0.699999988))
  729. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.200000003, 0.200000003))
  730. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.000427246094, -2.58794498, 0.839736938, -1, -1.49499328e-008, -2.52553122e-007, 2.52551388e-007, 1.52605935e-005, -1, 1.49906327e-008, -1, -1.52605971e-005))
  731. mesh("SpecialMesh",Part,Enum.MeshType.Wedge,"",Vector3.new(0, 0, 0),Vector3.new(0.699999988, 0.699999988, 0.699999988))
  732. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.200000003, 0.200000003))
  733. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.83972168, -2.44782782, -0.000438690186, 1.45468562e-007, -1, -2.04852658e-005, -2.09350546e-007, 2.04852604e-005, -1, 1, 1.45436047e-007, -2.09346027e-007))
  734. mesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(0.699999988, 0.699999988, 0.699999988))
  735. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.200000003, 0.200000003))
  736. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.000421524048, 2.30780578, 0.83972168, 1, 5.67174197e-007, 2.54727388e-006, -2.54726456e-006, -1.37063362e-005, 1, 5.67245934e-007, -1, -1.37063407e-005))
  737. mesh("SpecialMesh",Part,Enum.MeshType.Wedge,"",Vector3.new(0, 0, 0),Vector3.new(0.699999988, 0.699999988, 0.699999988))
  738. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.200000003, 0.200000003))
  739. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.00043296814, 2.30763364, -0.27973938, -1, 1.49386779e-008, 2.53097255e-007, 2.53098563e-007, -1.32949481e-005, 1, 1.49050265e-008, 1, 1.32949544e-005))
  740. mesh("SpecialMesh",Part,Enum.MeshType.Wedge,"",Vector3.new(0, 0, 0),Vector3.new(0.699999988, 0.699999988, 0.699999988))
  741. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.200000003, 0.200000003))
  742. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.279750824, 2.44781303, -0.000444412231, 1.45382273e-007, 1, 2.08481797e-005, -2.08853876e-007, -2.08481761e-005, 1, 1, -1.45423428e-007, 2.08852413e-007))
  743. mesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(0.699999988, 0.699999988, 0.699999988))
  744. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.200000003, 0.200000003))
  745. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.00043296814, -2.58781743, -0.279773712, 1, -5.67145435e-007, -2.54751899e-006, -2.54751376e-006, 1.19385704e-005, -1, 5.67138841e-007, 1, 1.19385777e-005))
  746. mesh("SpecialMesh",Part,Enum.MeshType.Wedge,"",Vector3.new(0, 0, 0),Vector3.new(0.699999988, 0.699999988, 0.699999988))
  747. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.231000006, 0.200000003, 0.280000031))
  748. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.560119629, -2.59035707, -0.000175476074, 3.96057294e-006, -1, -2.42740825e-005, -2.09122135e-007, 2.42740789e-005, -1, 1, 3.96054475e-006, -2.09025103e-007))
  749. mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.699999988, 1))
  750. Barrel=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Really black","Barrel",Vector3.new(0.200000003, 0.200000003, 0.280000031))
  751. Barrelweld=weld(m,FakeHandle,Barrel,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.562404633, -2.59142828, -0.000175476074, 3.96057203e-006, -1, -2.4095265e-005, -2.09117701e-007, 2.40952577e-005, -1, 1, 3.96054384e-006, -2.09021465e-007))
  752. mesh("CylinderMesh",Barrel,"","",Vector3.new(0, 0, 0),Vector3.new(0.945000052, 0.699999988, 1))
  753. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.420000017, 0.200000003, 0.280000031))
  754. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.559753418, -1.60731864, -0.000179290771, 1.45490958e-007, -1, -2.51584643e-005, -2.09002877e-007, 2.51584588e-005, -1, 1, 1.45459353e-007, -2.0899769e-007))
  755. mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.699999988, 1))
  756. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.420000017, 0.200000003, 0.280000031))
  757. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.559776306, -2.16727662, -0.000164031982, 1.45485501e-007, -1, -2.33735591e-005, -2.08965247e-007, 2.33735518e-005, -1, 1, 1.45453555e-007, -2.08960316e-007))
  758. mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.699999988, 1))
  759. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.420000017, 0.420000046, 0.280000031))
  760. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.559776306, -1.88730073, -0.000165939331, 1.45485956e-007, -1, -2.35518892e-005, -2.08967805e-007, 2.35518837e-005, -1, 1, 1.4545401e-007, -2.08962845e-007))
  761. mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1))
  762. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.420000017, 0.280000061, 0.280000031))
  763. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.559753418, -1.39711809, -0.000173568726, 1.45514491e-007, -1, -2.24795003e-005, -2.08946716e-007, 2.24794821e-005, -1, 1, 1.45416834e-007, -2.08939554e-007))
  764. mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1))
  765. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.420000017, 0.420000046, 0.200000003))
  766. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.559764862, -1.88847375, -0.000436782837, 1.45466288e-007, -1, -1.8521725e-005, -2.08988865e-007, 1.85217195e-005, -1, 1, 1.45433319e-007, -2.08984645e-007))
  767. mesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 0.699999988))
  768. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.420000017, 0.560000062, 0.200000003))
  769. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.559757233, -1.39839482, -0.000442504883, 1.45464355e-007, -1, -1.69149826e-005, -2.08905689e-007, 1.69149753e-005, -1, 1, 1.45431045e-007, -2.08901696e-007))
  770. mesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 0.699999988))
  771. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.420000046, 0.287, 0.420000017))
  772. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.559772491, 0.00134277344, -0.0700860023, -7.44953468e-008, -1, -4.73725959e-006, 1, -7.45317266e-008, -7.42083941e-008, 7.42095523e-008, -4.73725368e-006, 1))
  773. mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1))
  774. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.420000046, 0.287, 0.280000031))
  775. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.559783936, 0.00134277344, -0.420075655, -7.44639692e-008, -1, -5.6308827e-006, 1, -7.45658326e-008, -7.42004715e-008, 7.42039248e-008, -5.63086405e-006, 1))
  776. mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1))
  777. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.420000017, 0.280000001, 0.560000062))
  778. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.5598526, 1.52587891e-005, 1.11974049, 5.9590775e-008, 1, 2.51883012e-006, -1, 5.96276095e-008, 3.44174609e-008, 3.441885e-008, -2.51882193e-006, 1))
  779. mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 1, 1))
  780. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0.5,0,"New Yeller","Part",Vector3.new(0.200000003, 0.200000003, 0.200000003))
  781. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.00018119812, -0.844371796, 0.276464224, 1, -2.20552465e-011, 1.82033399e-011, -1.47792889e-011, 1, 1.78784603e-006, -1.66827021e-011, -1.78783966e-006, 1))
  782. mesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(0.735000134, 0.699999988, 0.699999988))
  783. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.280000001, 0.200000003, 0.280000091))
  784. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(-0.769760132, 0.000406265259, -0.279969931, 5.95582605e-008, 1, 2.26564134e-006, -1, 5.96603513e-008, 3.44175426e-008, 3.44209745e-008, -2.26562315e-006, 1))
  785. mesh("CylinderMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(1, 0.699999988, 1))
  786. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.700000048, 0.200000003))
  787. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.839698792, -0.0692727566, -0.000392913818, 1.45439344e-007, -1, -9.2651635e-006, -2.0875224e-007, 9.26515713e-006, -1, 1, 1.45404442e-007, -2.0874937e-007))
  788. mesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(0.699999988, 1, 0.699999988))
  789. Part=part(Enum.FormFactor.Custom,m,Enum.Material.SmoothPlastic,0,0,"Institutional white","Part",Vector3.new(0.200000003, 0.699999988, 0.200000003))
  790. Partweld=weld(m,FakeHandle,Part,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0.839668274, -0.768940926, -0.000394821167, 1.45451168e-007, -1, -1.17661502e-005, -2.08743202e-007, 1.17661421e-005, -1, 1, 1.45416834e-007, -2.08739948e-007))
  791. mesh("BlockMesh",Part,"","",Vector3.new(0, 0, 0),Vector3.new(0.699999988, 1, 0.699999988))
  792.  
  793. Handleweld.Part0 = LeftLeg
  794. Handleweld.C0 = angles(-2, 0, 0) * cf(-.5, 1.3, 1)
  795.  
  796. local PE1 = Create("ParticleEmitter"){
  797. Parent = Barrel,
  798. Color = ColorSequence.new(BrickColor.new("New Yeller").Color),
  799. Transparency = NumberSequence.new(0),
  800. Size = NumberSequence.new(.5),
  801. Texture = "rbxassetid://257430870",
  802. Lifetime = NumberRange.new(.1),
  803. Rate = 100,
  804. VelocitySpread = 180,
  805. Rotation = NumberRange.new(0),
  806. Speed = NumberRange.new(0),
  807. LightEmission = .6,
  808. LockedToPart = true,
  809. Enabled = false
  810. }
  811.  
  812. local PE2 = PE1:Clone()
  813. PE2.Size = NumberSequence.new(.7)
  814. PE2.LightEmission = 1
  815. PE2.Texture = "rbxassetid://87729590"
  816.  
  817. local Lite = Create("PointLight"){
  818. Parent = Barrel,
  819. Color = BrickColor.new("New Yeller").Color,
  820. Shadows = true,
  821. Range = 10,
  822. Brightness = 0.5,
  823. Enabled = false
  824. }
  825.  
  826. function Equip()
  827. attack = true
  828. equipped = true
  829. RSH.Parent = nil
  830. LSH.Parent = nil
  831.  
  832. RHP.Parent = nil
  833. LHP.Parent = nil
  834.  
  835. RW = Create("Weld"){
  836. Name = "Right Shoulder",
  837. Part0 = Torso ,
  838. C0 = cf(1.5, 0.5, 0),
  839. C1 = cf(0, 0.5, 0),
  840. Part1 = RightArm ,
  841. Parent = Torso ,
  842. }
  843.  
  844. LW = Create("Weld"){
  845. Name = "Left Shoulder",
  846. Part0 = Torso ,
  847. C0 = cf(-1.5, 0.5, 0),
  848. C1 = cf(0, 0.5, 0) ,
  849. Part1 = LeftArm ,
  850. Parent = Torso ,
  851. }
  852.  
  853. RH = Create("Weld"){
  854. Part0 = Torso,
  855. C0 = cf(0, -1.5, 0), --* euler(1.3, 0, -0.5)
  856. C1 = cf(-0.5, 0.5, 0) ,
  857. Part1 = Character["Right Leg"],
  858. Parent = Torso,
  859. }
  860.  
  861. LH = Create("Weld"){
  862. Part0 = Torso,
  863. C0 = cf(0, -1.5, 0), --* euler(1.3, 0, -0.5)
  864. C1 = cf(0.5, 0.5, 0) ,
  865. Part1 = Character["Left Leg"],
  866. Parent = Torso,
  867. }
  868.  
  869. for i = 0, 1, 0.1 do
  870. swait()
  871. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  872. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(30), math.rad(0), math.rad(30)), .3)
  873. RW.C0 = clerp(RW.C0, CFrame.new(0, 0.2, -.5) * angles(math.rad(20), math.rad(0), math.rad(-50)), 0.3)
  874. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-5), math.rad(0), math.rad(-10)), 0.3)
  875. RH.C0 = clerp(RH.C0, cf(0.03, -1.5, 0) * angles(math.rad(0), math.rad(0), math.rad(2)), .3)
  876. LH.C0 = clerp(LH.C0, cf(-0.03, -1.5, 0) * angles(math.rad(0), math.rad(0), math.rad(-2)), .3)
  877. end
  878. Handleweld.Part0 = RightArm
  879. Handleweld.C0 = euler(0, 0, 0) * cf(0, 0, 0)
  880. attack = false
  881. end
  882.  
  883. function Unequip()
  884. equipped = false
  885. attack = true
  886. for i = 0, 1, 0.1 do
  887. swait()
  888. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  889. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(30), math.rad(0), math.rad(30)), .3)
  890. RW.C0 = clerp(RW.C0, CFrame.new(.5, 0.2, -.7) * angles(math.rad(20), math.rad(0), math.rad(-50)), 0.3)
  891. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-30), math.rad(0), math.rad(-30)), 0.3)
  892. RH.C0 = clerp(RH.C0, cf(0.05, -1.5, 0) * angles(math.rad(0), math.rad(0), math.rad(5)), .3)
  893. LH.C0 = clerp(LH.C0, cf(-0.05, -1.5, 0) * angles(math.rad(0), math.rad(0), math.rad(-5)), .3)
  894. FakeHandleweld.C0 = clerp(FakeHandleweld.C0, cf(0, 0, 0) *euler(6*i,0,0), .5)
  895. end
  896. FakeHandleweld.C0 = angles(0, 0, 0) * cf(0, 0, 0)
  897. Handleweld.Part0 = LeftLeg
  898. Handleweld.C0 = angles(-2, 0, 0) * cf(-.5, 1.3, 1)
  899. RW.Parent = nil
  900. LW.Parent = nil
  901. RH.Parent = nil
  902. LH.Parent = nil
  903. RSH.Parent = Torso
  904. LSH.Parent = Torso
  905. RHP.Parent = Torso
  906. LHP.Parent = Torso
  907. Torso.Neck.C0 = necko
  908. RootJoint.C0 = RootCF
  909. RW.C0 = cf(1.5, 0.5, 0) * euler(0, 0, 0)
  910. RW.C1 = cf(0, 0.5, 0) * euler(0, 0, 0)
  911. LW.C0 = cf(-1.5, 0.5, 0) * euler(0, 0, 0)
  912. LW.C1 = cf(0, 0.5, 0) * euler(0, 0, 0)
  913. attack = false
  914. end
  915.  
  916. function CylinderEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  917. local prt = part(3, Character, "Neon", 0, 0, brickcolor, "Effect", vt(0.2, 0.2, 0.2))
  918. prt.Anchored = true
  919. prt.CFrame = cframe
  920. local msh = mesh("CylinderMesh", prt, "", "", vt(0, 0, 0), vt(x1, y1, z1))
  921. game:GetService("Debris"):AddItem(prt, 5)
  922. Effects[#Effects + 1] = {
  923. prt,
  924. "Cylinder",
  925. delay,
  926. x3,
  927. y3,
  928. z3
  929. } --part, type, delay
  930. end
  931.  
  932. function MagnitudeDamage(Hit, Part, magni, mindam, maxdam, knock, Type)
  933. for _, c in pairs(workspace:children()) do
  934. local hum = c:findFirstChild("Humanoid")
  935. if hum ~= nil then
  936. local head = c:findFirstChild("Torso")
  937. if head ~= nil then
  938. local targ = head.Position - Part.Position
  939. local mag = targ.magnitude
  940. if mag <= magni and c.Name ~= Player.Name then
  941. Damagefunc(Hit, head, mindam, maxdam, knock, Type, RootPart, 0, "rbxassetid://199149186", 1)
  942. end
  943. end
  944. end
  945. end
  946. end
  947.  
  948. RailgunTarget = RootPart
  949. function Laser(asd)
  950. local MouseLook=cf((asd.Position+mouse.Hit.p)/2,mouse.Hit.p)
  951. local hit,pos = rayCast(asd.Position,MouseLook.lookVector,999,RailgunTarget.Parent)
  952. local mag=(asd.Position-pos).magnitude
  953. CylinderEffect(BrickColor.new("New Yeller"),CFrame.new((asd.Position+pos)/2,pos)*angles(1.57,0,0),1,mag*5,1,1.2,0,1.2,0.1)
  954. CylinderEffect(BrickColor.new("Institutional white"),CFrame.new((asd.Position+pos)/2,pos)*angles(1.57,0,0),1,mag*5,.5,1,0,.5,0.1)
  955. if hit~=nil then
  956. local ref=part(3,workspace,"SmoothPlastic",0,1,BrickColor.new("New Yeller"),"Reference",vt())
  957. ref.Anchored=true
  958. ref.CFrame=cf(pos)
  959. game:GetService("Debris"):AddItem(ref,1)
  960. Damagefunc(ref,hit,20,90,0,"Normal",RootPart,0)
  961. end
  962. end
  963.  
  964. RocketTarget = RootPart
  965. function Shoot(asd, spread1, spread2)
  966. local MainPos = asd.Position
  967. local MainPos2 = mouse.Hit.p
  968. local spread = vt((math.random(-spread1, 0) + math.random()) * spread2, (math.random(-spread1, 0) + math.random()) * spread2, (math.random(-spread1, 0) + math.random()) * spread2) * (asd.Position - mouse.Hit.p).magnitude / 100
  969. local MouseLook = cf((MainPos + MainPos2) / 2, MainPos2 + spread)
  970. num = 30
  971. coroutine.resume(coroutine.create(function(Spreaded)
  972. repeat
  973. wait()
  974. local hit, pos = rayCast(MainPos, MouseLook.lookVector, 10, RocketTarget.Parent)
  975. local TheHit = mouse.Hit.p
  976. local mag = (MainPos - pos).magnitude
  977. CylinderEffect(BrickColor.new("New Yeller"), CFrame.new((MainPos + pos) / 2, pos) * angles(1.57, 0, 0), 3, mag * 5, 3, .5, 0, 1.5, 0.1)
  978. MainPos = MainPos + (MouseLook.lookVector * 10)
  979. num = num - 1
  980. if hit ~= nil then
  981. num = 0
  982. local ref = part(3, workspace, "Neon", 0, 1, BrickColor.new("New Yeller"), "Reference", vt())
  983. ref.Anchored = true
  984. ref.CFrame = cf(pos)
  985. MagnitudeDamage(ref, hit, 5, 10, 20, 1, "Normal")
  986. game:GetService("Debris"):AddItem(ref, 5)
  987. end
  988. until num <= 0
  989. end))
  990. end
  991.  
  992. function ChargeEffect(part, x1, y1, z1, x2, y2, z2, x3, y3, z3, color)
  993. local S = Create("Part"){
  994. Material = "SmoothPlastic",
  995. Name = "Effect",
  996. formFactor = 0,
  997. Size = vt(x1, y1, z1),
  998. BrickColor = color,
  999. Reflectance = 0,
  1000. TopSurface = 0,
  1001. BottomSurface = 0,
  1002. Transparency = 0,
  1003. Anchored = false,
  1004. CanCollide = false,
  1005. Material = "Neon",
  1006. CFrame = part.CFrame * cf(x2, y2, z2) * euler(x3, y3, z3),
  1007. Parent = m,
  1008. }
  1009. local msh1 = Create("SpecialMesh"){
  1010. Scale = vt(0.5, 0.5, 0.5) ,
  1011. MeshType = "Sphere",
  1012. Parent = S,
  1013. }
  1014. coroutine.resume(coroutine.create(function(Part, CF)
  1015. local f = Instance.new("BodyPosition")
  1016. f.P = 800
  1017. f.D = 100
  1018. f.maxForce = vt(math.huge, math.huge, math.huge)
  1019. f.position = part.Position
  1020. f.Parent = Part
  1021. for i = 0, 1, 0.1 do
  1022. wait()
  1023. Part.Transparency = Part.Transparency + 0.1
  1024. end
  1025. Part.Parent = nil
  1026. end), S, S.CFrame)
  1027. end
  1028.  
  1029. local lasrs = {}
  1030. local lasrspd = 3
  1031. local maxTravelDistance = 500
  1032. local maxRebounds = 20
  1033.  
  1034. function RAY(pos, dir, collidedlist, startpos, endpos, distleft)
  1035. collidedlist = collidedlist or {Character}
  1036. startpos = startpos or pos
  1037. distleft = distleft or dir.unit * dir.magnitude
  1038. endpos = endpos or pos + distleft
  1039. local ray = Ray.new(pos, distleft)
  1040. local hitz,enz = workspace:FindPartOnRayWithIgnoreList(ray, collidedlist)
  1041. if hitz ~= nil and not hitz.Parent:findFirstChild("Humanoid") then
  1042. if hitz.CanCollide == false then
  1043. table.insert(collidedlist, hitz)
  1044. local newpos = enz
  1045. local newdistleft = distleft - (dir.unit * (pos - newpos).magnitude)
  1046. if newdistleft then
  1047. return RAY(newpos-(dir*0.01), dir, collidedlist, startpos, endpos, newdistleft+(dir*0.01))
  1048. end
  1049. end
  1050. end
  1051. return hitz, enz, ray
  1052. end
  1053.  
  1054. function FindSurface(part, position)
  1055. local obj = part.CFrame:pointToObjectSpace(position)
  1056. local siz = part.Size/2
  1057. so("rbxassetid://199144144", workspace, 1, .9)
  1058. for i,v in pairs(Enum.NormalId:GetEnumItems()) do
  1059. local vec = Vector3.FromNormalId(v)
  1060. local wvec = part.CFrame:vectorToWorldSpace(vec)
  1061. local vz = (obj)/(siz*vec)
  1062. if (math.abs(vz.X-1) < 0.001 or math.abs(vz.Y-1) < 0.001 or math.abs(vz.Z-1) < 0.001) then
  1063. return wvec,vec
  1064. end
  1065. end
  1066. if part.className == "WedgePart" then
  1067. local pos = (part.CFrame * CFrame.new(0,part.Size.y/2,part.Size.z/2)).p
  1068. local apos = (part.CFrame * CFrame.Angles(-math.atan2(part.CFrame:pointToObjectSpace(pos).y,part.CFrame:pointToObjectSpace(pos).z),0,0) * CFrame.new(0,1,0)).p
  1069. local wvec,vec = (apos - part.Position).unit, part.CFrame:pointToObjectSpace(apos)
  1070. return wvec,vec
  1071. elseif part.className == "Part" and (part.Shape.Name == "Ball" or part.Shape.Name == "Cylinder") then
  1072. return (position - part.Position).unit, part.CFrame:vectorToObjectSpace((position - part.Position).unit)
  1073. end
  1074. end
  1075.  
  1076. function Reflect(direction, normal)
  1077. return direction - 2 * normal:Dot(direction) * normal
  1078. end
  1079.  
  1080. function ReflectShot(mouse)
  1081. local dir = (mouse.Hit.p - Torso.Position).unit
  1082. local tabl
  1083. local tablnum = 0
  1084. for i, v in pairs(lasrs) do
  1085. if not v[1] then
  1086. tabl = v
  1087. tablnum = i
  1088. break
  1089. end
  1090. end
  1091. if not tabl then
  1092. tablnum = #lasrs + 1
  1093. tabl = {false,nil,nil,0,0,1,{},{},{},{}}
  1094. for i = 1, 2 do
  1095. for j = 1, 6 do
  1096. local p = Instance.new("Part")
  1097. p.FormFactor = "Custom"
  1098. p.CanCollide = false
  1099. p.Anchored = true
  1100. p.Locked = true
  1101. p.BrickColor = BrickColor.new("New Yeller")
  1102. p.TopSurface = 10
  1103. p.BottomSurface = 10
  1104. p.RightSurface = 10
  1105. p.LeftSurface = 10
  1106. p.FrontSurface = 10
  1107. p.BackSurface = 10
  1108. p.Size = Vector3.new(1,1,1)
  1109. p.Material = "Neon"
  1110. p.Transparency = i == 1 and 0 or 0.6
  1111. p.Touched:connect(function(hit)
  1112. hit.Parent.Humanoid:TakeDamage(30)
  1113. end)
  1114. local mesh = Instance.new("CylinderMesh",p)
  1115. table.insert(tabl[6+i],p)
  1116. table.insert(tabl[8+i],mesh)
  1117. end
  1118. end
  1119. table.insert(lasrs,tabl)
  1120. end
  1121. -- isMoving,direction,lastPosition,rebounds,distance,recycleCount,middleLayer,outerLayer
  1122. tabl[4],tabl[5] = 0,0
  1123. tabl[3] = Barrel.Position
  1124. tabl[2] = dir
  1125. tabl[1] = true
  1126.  
  1127. end
  1128.  
  1129. local MultiShoot = false
  1130. local gun = false
  1131. local shoot = false
  1132. local Obliterate = false
  1133. local LaserMode = false
  1134. function Aim()
  1135. attack = true
  1136. gun = true
  1137. for i = 0, 1, 0.2 do
  1138. swait()
  1139. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(90)), .5)
  1140. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(0), math.rad(0), math.rad(-90)), .5)
  1141. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(90), math.rad(0), math.rad(90)), 0.5)
  1142. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-10), math.rad(0), math.rad(-20)), 0.5)
  1143. RH.C0 = clerp(RH.C0, cf(0.05, -1.5, 0) * angles(math.rad(5), math.rad(0), math.rad(5)), .5)
  1144. LH.C0 = clerp(LH.C0, cf(-0.05, -1.5, 0) * angles(math.rad(0), math.rad(0), math.rad(-5)), .5)
  1145. end
  1146. RootJoint.C0 = RootCF * cf(0, 0, 0) * euler(0, 0, 1.57)
  1147. RW.C0 = cf(1.5, 0.5, 0) * euler(1.57, 0, 1.57)
  1148. local gairo = Create("BodyGyro"){
  1149. Parent = RootPart,
  1150. maxTorque = Vector3.new(4e+005, 4e+005, 4e+005) * math.huge ,
  1151. P = 20e+003 ,
  1152. cframe = RootPart.CFrame,
  1153. }
  1154. local offset = nil
  1155. while gun == true do
  1156. swait()
  1157. local gunpos = vt(mouse.Hit.p.x, Head.Position.Y, mouse.Hit.p.z)
  1158. offset = (Torso.Position.y - mouse.Hit.p.y) / 60
  1159. local mag = (Torso.Position - mouse.Hit.p).magnitude / 80
  1160. offset = offset / mag
  1161. gairo.cframe = cf(Head.Position, gunpos)
  1162. Neck.C0 = clerp(Neck.C0, necko * euler(0, 0, -1.57), .3)
  1163. RW.C1 = clerp(RW.C1, cf(0, 0.5, 0) * euler(offset, 0, 0), .5)
  1164. end
  1165. if shoot == true then
  1166. gairo.Parent = nil
  1167. PE1.Enabled,PE2.Enabled = true,true
  1168. Lite.Enabled = true
  1169. for i = 0, 1, 0.1 do
  1170. swait()
  1171. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(90)), .3)
  1172. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(0), math.rad(5), math.rad(-90)), .3)
  1173. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(90), math.rad(50), math.rad(90)), 0.3)
  1174. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-20), math.rad(0), math.rad(-40)), 0.3)
  1175. RH.C0 = clerp(RH.C0, cf(0.05, -1.5, 0) * angles(math.rad(5), math.rad(0), math.rad(5)), .3)
  1176. LH.C0 = clerp(LH.C0, cf(-0.05, -1.5, 0) * angles(math.rad(0), math.rad(0), math.rad(-5)), .3)
  1177. FakeHandleweld.C0 = clerp(FakeHandleweld.C0, cf(0, 0, 0) * angles(math.rad(30), math.rad(0), math.rad(0)), .3)
  1178. end
  1179. Lite.Enabled = false
  1180. PE1.Enabled,PE2.Enabled = false,false
  1181. elseif MultiShoot == true then
  1182. gairo.Parent = nil
  1183. for i = 1,5 do
  1184. so("rbxassetid://199144089", Barrel, 1, 1.1)
  1185. Shoot(Barrel, .2, 1)
  1186. PE1.Enabled,PE2.Enabled = true,true
  1187. Lite.Enabled = true
  1188. for i = 0,1,1 do
  1189. swait()
  1190. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(90)), .5)
  1191. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(0), math.rad(2), math.rad(-90)), .5)
  1192. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(90), math.rad(50), math.rad(90)), 0.5)
  1193. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-20), math.rad(0), math.rad(-40)), 0.5)
  1194. RH.C0 = clerp(RH.C0, cf(0.05, -1.5, 0) * angles(math.rad(5), math.rad(0), math.rad(5)), .5)
  1195. LH.C0 = clerp(LH.C0, cf(-0.05, -1.5, 0) * angles(math.rad(0), math.rad(0), math.rad(-5)), .5)
  1196. FakeHandleweld.C0 = clerp(FakeHandleweld.C0, cf(0, 0, 0) * angles(math.rad(30), math.rad(0), math.rad(0)), .3)
  1197. end
  1198. PE1.Enabled,PE2.Enabled = false,false
  1199. Lite.Enabled = false
  1200. for i = 0,1,1 do
  1201. swait()
  1202. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(90)), .5)
  1203. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(0), math.rad(0), math.rad(-90)), .5)
  1204. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(90), math.rad(0), math.rad(90)), 0.5)
  1205. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-10), math.rad(0), math.rad(-20)), 0.5)
  1206. RH.C0 = clerp(RH.C0, cf(0.05, -1.5, 0) * angles(math.rad(5), math.rad(0), math.rad(5)), .5)
  1207. LH.C0 = clerp(LH.C0, cf(-0.05, -1.5, 0) * angles(math.rad(0), math.rad(0), math.rad(-5)), .5)
  1208. FakeHandleweld.C0 = clerp(FakeHandleweld.C0, cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  1209. end
  1210. end
  1211. elseif LaserMode == true then
  1212. gairo.Parent = nil
  1213. so("rbxassetid://161006157", Barrel, 1, .9)
  1214. so("rbxassetid://161006131", Barrel, 1, 1.2)
  1215. for i = 1, 30 do
  1216. swait()
  1217. ChargeEffect(Barrel, 2, 2, 2, math.random(-10, 10), math.random(-10, 10), math.random(-10, 10), 0, 0, 0, BrickColor.new("New Yeller"))
  1218. end
  1219. so("rbxassetid://199144089", Barrel, 1, .8)
  1220. so("rbxassetid://199144089", Barrel, 1, .5)
  1221. Laser(Barrel)
  1222. PE1.Enabled,PE2.Enabled = true,true
  1223. Lite.Enabled = true
  1224. for i = 0, 1, 0.1 do
  1225. swait()
  1226. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(90)), .3)
  1227. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(0), math.rad(5), math.rad(-90)), .3)
  1228. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(90), math.rad(50), math.rad(90)), 0.3)
  1229. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-20), math.rad(0), math.rad(-40)), 0.3)
  1230. RH.C0 = clerp(RH.C0, cf(0.05, -1.5, 0) * angles(math.rad(5), math.rad(0), math.rad(5)), .3)
  1231. LH.C0 = clerp(LH.C0, cf(-0.05, -1.5, 0) * angles(math.rad(0), math.rad(0), math.rad(-5)), .3)
  1232. FakeHandleweld.C0 = clerp(FakeHandleweld.C0, cf(0, 0, 0) * angles(math.rad(30), math.rad(0), math.rad(0)), .3)
  1233. end
  1234. PE1.Enabled,PE2.Enabled = false,false
  1235. Lite.Enabled = false
  1236. elseif Obliterate == true then
  1237. gairo.Parent = nil
  1238. so("rbxassetid://161006157", Barrel, 1, .7)
  1239. so("rbxassetid://161006131", Barrel, 1, 1)
  1240. for i = 1, 60 do
  1241. swait()
  1242. ChargeEffect(Barrel, 2, 2, 2, math.random(-10, 10), math.random(-10, 10), math.random(-10, 10), 0, 0, 0, BrickColor.new("New Yeller"))
  1243. end
  1244. for i = 1, 5 do
  1245. so("rbxassetid://199144089", Barrel, 1, .8)
  1246. for i = 1, 5 do
  1247. Shoot(Barrel, 1, 3)
  1248. end
  1249. PE1.Enabled,PE2.Enabled = true,true
  1250. Lite.Enabled = true
  1251. for i = 0, 1, 0.2 do
  1252. swait()
  1253. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(90)), .5)
  1254. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(0), math.rad(5), math.rad(-90)), .5)
  1255. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.8, 0) * angles(math.rad(90), math.rad(50), math.rad(90)), 0.5)
  1256. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-20), math.rad(0), math.rad(-40)), 0.5)
  1257. RH.C0 = clerp(RH.C0, cf(0.05, -1.5, 0) * angles(math.rad(5), math.rad(0), math.rad(5)), .5)
  1258. LH.C0 = clerp(LH.C0, cf(-0.05, -1.5, 0) * angles(math.rad(0), math.rad(0), math.rad(-5)), .5)
  1259. FakeHandleweld.C0 = clerp(FakeHandleweld.C0, cf(0, 0, 0) * angles(math.rad(30), math.rad(0), math.rad(0)), .3)
  1260. end
  1261. PE1.Enabled,PE2.Enabled = false,false
  1262. Lite.Enabled = false
  1263. for i = 0, 1, 0.2 do
  1264. swait()
  1265. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(90)), .3)
  1266. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(0), math.rad(0), math.rad(-90)), .3)
  1267. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(90), math.rad(0), math.rad(90)), 0.3)
  1268. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-10), math.rad(0), math.rad(-20)), 0.3)
  1269. RH.C0 = clerp(RH.C0, cf(0.05, -1.5, 0) * angles(math.rad(5), math.rad(0), math.rad(5)), .3)
  1270. LH.C0 = clerp(LH.C0, cf(-0.05, -1.5, 0) * angles(math.rad(0), math.rad(0), math.rad(-5)), .3)
  1271. FakeHandleweld.C0 = clerp(FakeHandleweld.C0, cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  1272. end
  1273. end
  1274.  
  1275. for i = 0, 1, 0.1 do
  1276. swait()
  1277. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(50)), .3)
  1278. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(5), math.rad(-5), math.rad(-55)), .3)
  1279. RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.5, -.5) * angles(math.rad(0), math.rad(130), math.rad(80)), 0.3)
  1280. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-10), math.rad(0), math.rad(-20)), 0.3)
  1281. RH.C0 = clerp(RH.C0, cf(0.05, -1.5, 0) * angles(math.rad(5), math.rad(0), math.rad(5)), .3)
  1282. LH.C0 = clerp(LH.C0, cf(-0.05, -1.5, 0) * angles(math.rad(0), math.rad(0), math.rad(-5)), .3)
  1283. FakeHandleweld.C0 = clerp(FakeHandleweld.C0, cf(0, 0, 0) * angles(math.rad(10), math.rad(0), math.rad(0)), .3)
  1284. end
  1285. so("rbxassetid://161006157", Barrel, 1, .9)
  1286. so("rbxassetid://161006131", Barrel, 1, 1.2)
  1287. for i = 1, 30 do
  1288. swait()
  1289. ChargeEffect(Barrel, 2, 2, 2, math.random(-10, 10), math.random(-10, 10), math.random(-10, 10), 0, 0, 0, BrickColor.new("New Yeller"))
  1290. end
  1291. for i = 0, 1, 0.05 do
  1292. swait()
  1293. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(90)), .3)
  1294. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(0), math.rad(1), math.rad(-85)), .3)
  1295. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(0), math.rad(0), math.rad(90)), 0.3)
  1296. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-10), math.rad(0), math.rad(-20)), 0.3)
  1297. RH.C0 = clerp(RH.C0, cf(0.05, -1.5, 0) * angles(math.rad(5), math.rad(0), math.rad(5)), .3)
  1298. LH.C0 = clerp(LH.C0, cf(-0.05, -1.5, 0) * angles(math.rad(0), math.rad(0), math.rad(-5)), .3)
  1299. FakeHandleweld.C0 = clerp(FakeHandleweld.C0, cf(0, 0, 0) * angles(math.rad(20), math.rad(0), math.rad(0)), .3)
  1300. end
  1301. so("rbxassetid://199144089", Barrel, 1, .8)
  1302. so("rbxassetid://199144089", Barrel, 1, .9)
  1303. so("rbxassetid://199144089", Barrel, 1, .6)
  1304. for i = 1, 20 do
  1305. Shoot(Barrel, 1.5, 5)
  1306. end
  1307. PE1.Enabled,PE2.Enabled = true,true
  1308. Lite.Enabled = true
  1309. for i = 0, 1, 0.05 do
  1310. swait()
  1311. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(90)), .5)
  1312. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(0), math.rad(10), math.rad(-90)), .5)
  1313. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.8, 0) * angles(math.rad(0), math.rad(50), math.rad(120)), 0.5)
  1314. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-10), math.rad(0), math.rad(-20)), 0.5)
  1315. RH.C0 = clerp(RH.C0, cf(0.05, -1.5, 0) * angles(math.rad(5), math.rad(0), math.rad(5)), .5)
  1316. LH.C0 = clerp(LH.C0, cf(-0.05, -1.5, 0) * angles(math.rad(0), math.rad(0), math.rad(-5)), .5)
  1317. end
  1318. PE1.Enabled,PE2.Enabled = false,false
  1319. Lite.Enabled = false
  1320. end
  1321. gairo.Parent = nil
  1322. shoot = false
  1323. attack = false
  1324. end
  1325.  
  1326. mouse.Button1Down:connect(function()
  1327. if gun == true then
  1328. shoot = true
  1329. so("rbxassetid://199144089", Barrel, 1, 1)
  1330. Shoot(Barrel, 0, 0)
  1331. gun = false
  1332. end
  1333. end)
  1334.  
  1335.  
  1336.  
  1337. mouse.KeyDown:connect(function(k)
  1338. k = k:lower()
  1339. if attack == false and equipped == false and k == 'e' then
  1340. Equip()
  1341. elseif attack == false and equipped == true and k == 'e' then
  1342. Unequip()
  1343. elseif attack == false and equipped == true and k == 'f' then
  1344. Aim()
  1345. elseif equipped == true and k == 'f' then
  1346. shoot = false
  1347. elseif equipped == true and gun == true and k == 'q' then
  1348. shoot = true
  1349. so("rbxassetid://199144089", Barrel, 1, .8)
  1350. for i = 1, 5 do
  1351. Shoot(Barrel, 1, 3)
  1352. gun = false
  1353. end
  1354. elseif equipped == true and gun == true and k == 'e' then
  1355. MultiShoot = true
  1356. gun = false
  1357. elseif equipped == true and gun == true and k == 'r' then
  1358. MultiShoot = false
  1359. LaserMode = true
  1360. gun = false
  1361. elseif equipped == true and attack == true and gun == true and k == 't' then
  1362. MultiShoot = false
  1363. Obliterate = true
  1364. LaserMode = false
  1365. gun = false
  1366. elseif equipped == true and attack == true and gun == true and k == 'g' then
  1367. shoot = true
  1368. ReflectShot(mouse)
  1369. so("rbxassetid://199144089", Barrel, 1, .8)
  1370. so("rbxassetid://199144089", Barrel, 1, .5)
  1371. gun = false
  1372. end
  1373. end)
  1374.  
  1375. game:GetService("RunService").Stepped:connect(function()
  1376. for _, lasr in pairs(lasrs) do
  1377. for i, v in pairs(lasr[9]) do
  1378. if lasr[7][i].Parent then
  1379. v.Scale = v.Scale + Vector3.new(-0.1,0,-0.1)
  1380. lasr[10][i].Scale = lasr[10][i].Scale + Vector3.new(-0.1,0,-0.1)
  1381. if v.Scale.x < 0.1 then
  1382. lasr[7][i].Parent = nil
  1383. lasr[8][i].Parent = nil
  1384. end
  1385. end
  1386. end
  1387.  
  1388. if lasr[1] then
  1389. local hitz, enz = RAY(lasr[3],lasr[2]*lasrspd)
  1390. lasr[5] = lasr[5] + (lasr[3] - enz).magnitude
  1391.  
  1392. lasr[7][lasr[6]].Parent = m
  1393. lasr[7][lasr[6]].CFrame = CFrame.new((lasr[3] + enz)/2,enz) * CFrame.Angles(math.pi/2,0,0)
  1394. lasr[9][lasr[6]].Scale = Vector3.new(0.7,(lasr[3] - enz).magnitude*5,0.7)
  1395.  
  1396. lasr[8][lasr[6]].Parent = m
  1397. lasr[8][lasr[6]].CFrame = lasr[7][lasr[6]].CFrame
  1398. lasr[10][lasr[6]].Scale = Vector3.new(1.3,(lasr[3] - enz).magnitude*5 + 0.02,1.3)
  1399.  
  1400. lasr[3] = enz
  1401. lasr[6] = lasr[6]%#lasr[7] + 1
  1402.  
  1403. if hitz then
  1404. lasr[4] = lasr[4] + 1
  1405. if lasr[4] == maxRebounds then
  1406. lasr[1] = false
  1407. else
  1408. local norm = FindSurface(hitz,enz)
  1409. lasr[2] = Reflect(lasr[2],norm)
  1410. end
  1411. end
  1412. if lasr[5] > maxTravelDistance then
  1413. lasr[1] = false
  1414. end
  1415. end
  1416. end
  1417. end)
  1418.  
  1419. local sine = 0
  1420. local change = 1
  1421. local val = 0
  1422. local idle = 0
  1423. local donum = 0
  1424.  
  1425. while true do
  1426. swait()
  1427. sine = sine + change
  1428. mouse.Icon = "http://www.roblox.com/asset/?id=296383647"
  1429. local torvel = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude
  1430. local velderp = RootPart.Velocity.y
  1431. hitfloor, posfloor = rayCast(RootPart.Position, (CFrame.new(RootPart.Position, RootPart.Position - Vector3.new(0, 1, 0))).lookVector, 4, Character)
  1432. if equipped == true then
  1433. if attack == false then
  1434. idle = idle + 1
  1435. else
  1436. idle = 0
  1437. end
  1438. if idle >= 500 then
  1439. if attack == false then
  1440. end
  1441. end
  1442. if donum >= .5 then
  1443. handidle = true
  1444. elseif donum <= 0 then
  1445. handidle = false
  1446. end
  1447. if handidle == false then
  1448. donum = donum + 0.003
  1449. else
  1450. donum = donum - 0.003
  1451. end
  1452. if RootPart.Velocity.y > 1 and hitfloor == nil then
  1453. Anim = "Jump"
  1454. if attack == false then
  1455. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(-5), math.rad(0), math.rad(0)), .3)
  1456. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(10), math.rad(0), math.rad(0)), .3)
  1457. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(-20), math.rad(0), math.rad(30)), 0.3)
  1458. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-10), math.rad(0), math.rad(-20)), 0.3)
  1459. RH.C0 = clerp(RH.C0, cf(.05, -1.5, .5) * angles(math.rad(-20), math.rad(0), math.rad(5)), .3)
  1460. LH.C0 = clerp(LH.C0, cf(-.05, -1.5, .5) * angles(math.rad(-20), math.rad(0), math.rad(-5)), .3)
  1461. FakeHandleweld.C0 = clerp(FakeHandleweld.C0, cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  1462. RW.C1 = clerp(RW.C1, cf(0, 0.5, 0) * euler(0, 0, 0), .3)
  1463. end
  1464. elseif RootPart.Velocity.y < -1 and hitfloor == nil then
  1465. Anim = "Fall"
  1466. if attack == false then
  1467. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  1468. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(20), math.rad(0), math.rad(0)), .3)
  1469. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(-30), math.rad(0), math.rad(40)), 0.3)
  1470. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-20), math.rad(0), math.rad(-30)), 0.3)
  1471. RH.C0 = clerp(RH.C0, cf(0.05, -1.5, -.2) * angles(math.rad(10), math.rad(0), math.rad(5)), .3)
  1472. LH.C0 = clerp(LH.C0, cf(-0.05, -1.5, -.2) * angles(math.rad(10), math.rad(0), math.rad(-5)), .3)
  1473. FakeHandleweld.C0 = clerp(FakeHandleweld.C0, cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  1474. RW.C1 = clerp(RW.C1, cf(0, 0.5, 0) * euler(0, 0, 0), .3)
  1475. end
  1476. elseif torvel < 1 and hitfloor ~= nil then
  1477. Anim = "Idle"
  1478. if attack == false then
  1479. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(5) + donum / 3, math.rad(0), math.rad(30)), .3)
  1480. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(.5) - donum / 3, math.rad(.5) + donum / 3, math.rad(-30)), .3)
  1481. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(50), math.rad(0), math.rad(5) + donum / 2), 0.3)
  1482. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(-5) + donum / 2, math.rad(0), math.rad(-10)), 0.3)
  1483. RH.C0 = clerp(RH.C0, cf(.2, -1.5, -.5) * angles(math.rad(5) + donum / 2, math.rad(-30), math.rad(5) + donum / 5), .3)
  1484. LH.C0 = clerp(LH.C0, cf(0, -1.5 - donum / 3.5, 0) * angles(math.rad(5) + donum / 3, math.rad(-10), math.rad(0)), .3)
  1485. FakeHandleweld.C0 = clerp(FakeHandleweld.C0, cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  1486. RW.C1 = clerp(RW.C1, cf(0, 0.5, 0) * euler(0, 0, 0), .3)
  1487. end
  1488. elseif torvel > 2 and hitfloor ~= nil then
  1489. Anim = "Walk"
  1490. if attack == false then
  1491. change = 3
  1492. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cf(0, 0, 0) * angles(math.rad(20) + donum / 2, math.rad(0), math.rad(0)), .3)
  1493. Torso.Neck.C0 = clerp(Torso.Neck.C0, necko * angles(math.rad(-10) - donum / 2, math.rad(0), math.rad(0)), .3)
  1494. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(-50) + donum / 2, math.rad(0), math.rad(5) + donum / 2), 0.3)
  1495. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(20) + donum / 2, math.rad(0), math.rad(-5) - donum / 2), 0.3)
  1496. LH.C0 = clerp(LH.C0, CFrame.new(0, -1.5-0.3*math.cos(sine/10)/2, -.05 + math.sin(sine/10)/2) * CFrame.Angles(math.rad(3) + -math.sin(sine/10)/2.3, math.rad(0), math.rad(-3)), .4)
  1497. RH.C0 = clerp(RH.C0, CFrame.new(0, -1.5+0.3*math.cos(sine/10)/2, -.05 + -math.sin(sine/10)/2) * CFrame.Angles(math.rad(3) + math.sin(sine/10)/2.3, math.rad(0), math.rad(3)), .4)
  1498. FakeHandleweld.C0 = clerp(FakeHandleweld.C0, cf(0, 0, 0) * angles(math.rad(0), math.rad(0), math.rad(0)), .3)
  1499. RW.C1 = clerp(RW.C1, cf(0, 0.5, 0) * euler(0, 0, 0), .3)
  1500. end
  1501. end
  1502. end
  1503. if #Effects > 0 then
  1504. for e = 1, #Effects do
  1505. if Effects[e] ~= nil then
  1506. local Thing = Effects[e]
  1507. if Thing ~= nil then
  1508. local Part = Thing[1]
  1509. local Mode = Thing[2]
  1510. local Delay = Thing[3]
  1511. local IncX = Thing[4]
  1512. local IncY = Thing[5]
  1513. local IncZ = Thing[6]
  1514. if Thing[1].Transparency <= 1 then
  1515. if Thing[2] == "Block1" then
  1516. Thing[1].CFrame = Thing[1].CFrame * euler(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50))
  1517. Mesh = Thing[1].Mesh
  1518. Mesh.Scale = Mesh.Scale + vt(Thing[4], Thing[5], Thing[6])
  1519. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  1520. elseif Thing[2] == "Cylinder" then
  1521. Mesh = Thing[1].Mesh
  1522. Mesh.Scale = Mesh.Scale + vt(Thing[4], Thing[5], Thing[6])
  1523. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  1524. elseif Thing[2] == "Blood" then
  1525. Mesh = Thing[7]
  1526. Thing[1].CFrame = Thing[1].CFrame * cf(0, .5, 0)
  1527. Mesh.Scale = Mesh.Scale + vt(Thing[4], Thing[5], Thing[6])
  1528. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  1529. elseif Thing[2] == "Elec" then
  1530. Mesh = Thing[1].Mesh
  1531. Mesh.Scale = Mesh.Scale + vt(Thing[7], Thing[8], Thing[9])
  1532. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  1533. elseif Thing[2] == "Disappear" then
  1534. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  1535. end
  1536. else
  1537. Part.Parent = nil
  1538. table.remove(Effects, e)
  1539. end
  1540. end
  1541. end
  1542. end
  1543. end
  1544. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement