Advertisement
HenloMyDude

fixed reset gun thing idk

Sep 24th, 2019
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 40.16 KB | None | 0 0
  1. print("FE code by Starzozero, Thanks to him!")
  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 by Mokiros, Edited by StarzoZero")
  7. local rp = RealPlayer
  8. script.Parent = rp.Character
  9.  
  10. --RemoteEvent for communicating
  11. local Event = Instance.new("RemoteEvent")
  12. Event.Name = "UserInput_Event"
  13.  
  14. --Fake event to make stuff like Mouse.KeyDown work
  15. local function fakeEvent()
  16. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  17. t.connect = t.Connect
  18. return t
  19. end
  20.  
  21. --Creating fake input objects with fake variables
  22. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  23. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  24. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  25. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  26. end}
  27. --Merged 2 functions into one by checking amount of arguments
  28. CAS.UnbindAction = CAS.BindAction
  29.  
  30. --This function will trigger the events that have been :Connect()'ed
  31. local function te(self,ev,...)
  32. local t = m[ev]
  33. if t and t._fakeEvent then
  34. for _,f in pairs(t.Functions) do
  35. f(...)
  36. end
  37. end
  38. end
  39. m.TrigEvent = te
  40. UIS.TrigEvent = te
  41.  
  42. Event.OnServerEvent:Connect(function(plr,io)
  43. if plr~=rp then return end
  44. m.Target = io.Target
  45. m.Hit = io.Hit
  46. if not io.isMouse then
  47. local b = io.UserInputState == Enum.UserInputState.Begin
  48. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  49. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  50. end
  51. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  52. return m:TrigEvent(b and "Button2Down" or "Button2Up")
  53. end
  54. for _,t in pairs(CAS.Actions) do
  55. for _,k in pairs(t.Keys) do
  56. if k==io.KeyCode then
  57. t.Function(t.Name,io.UserInputState,io)
  58. end
  59. end
  60. end
  61. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  62. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  63. end
  64. end)
  65. Event.Parent = NLS([==[
  66. local Player = game:GetService("Players").LocalPlayer
  67. local Event = script:WaitForChild("UserInput_Event")
  68. local Mouse = Player:GetMouse()
  69. local UIS = game:GetService("UserInputService")
  70. local input = function(io,a)
  71. if a then return end
  72. --Since InputObject is a client-side instance, we create and pass table instead
  73. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  74. end
  75. UIS.InputBegan:Connect(input)
  76. UIS.InputEnded:Connect(input)
  77. local h,t
  78. --Give the server mouse data 30 times every second, but only if the values changed
  79. --If player is not moving their mouse, client won't fire events
  80. while wait(1/30) do
  81. if h~=Mouse.Hit or t~=Mouse.Target then
  82. h,t=Mouse.Hit,Mouse.Target
  83. Event:FireServer({isMouse=true,Target=t,Hit=h})
  84. end
  85. end]==],Player.Character)
  86.  
  87. ----Sandboxed game object that allows the usage of client-side methods and services
  88. --Real game object
  89. local _rg = game
  90.  
  91. --Metatable for fake service
  92. local fsmt = {
  93. __index = function(self,k)
  94. local s = rawget(self,"_RealService")
  95. if s then
  96. return typeof(s[k])=="function"
  97. and function(_,...)return s[k](s,...)end or s[k]
  98. end
  99. end,
  100. __newindex = function(self,k,v)
  101. local s = rawget(self,"_RealService")
  102. if s then s[k]=v end
  103. end
  104. }
  105. local function FakeService(t,RealService)
  106. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  107. return setmetatable(t,fsmt)
  108. end
  109.  
  110. --Fake game object
  111. local g = {
  112. GetService = function(self,s)
  113. return rawget(self,s) or _rg:GetService(s)
  114. end,
  115. Players = FakeService({
  116. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  117. },"Players"),
  118. UserInputService = FakeService(UIS,"UserInputService"),
  119. ContextActionService = FakeService(CAS,"ContextActionService"),
  120. RunService = FakeService({
  121. _btrs = {},
  122. RenderStepped = _rg:GetService("RunService").Heartbeat,
  123. BindToRenderStep = function(self,name,_,fun)
  124. self._btrs[name] = self.Heartbeat:Connect(fun)
  125. end,
  126. UnbindFromRenderStep = function(self,name)
  127. self._btrs[name]:Disconnect()
  128. end,
  129. },"RunService")
  130. }
  131. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  132. g.service = g.GetService
  133. FakeService(g,game)
  134. --Changing owner to fake player object to support owner:GetMouse()
  135. game,owner = g,g.Players.LocalPlayer
  136. end
  137.  
  138. --[[Start Up]]--
  139.  
  140. Plr = game:service'Players'.LocalPlayer
  141. Char = Plr.Character
  142. Mouse = Plr:GetMouse()
  143. head = Char.Head
  144. Numb = 34
  145. local sway = false
  146. local spread = 25
  147. Char.Humanoid.WalkSpeed = 25
  148. local CurA,StoA = 8,8*8
  149. local RTilt = 0
  150. local CurrentRightArmAngle = CFrame.new(0,0,0)
  151. local CurrentLeftArmAngle = CFrame.new(0,0,0)
  152. local CurCam = workspace.CurrentCamera
  153. local CurCamCF = CurCam.CoordinateFrame
  154. local MouseDown = false
  155. local Mouse2Down = false
  156. local CurAming = false
  157.  
  158. local ammo = 20
  159. local sine = 0;
  160. local change = 1;
  161. local attack = false
  162. local mouse = Plr:GetMouse()
  163. local defAnim = true;
  164. local UIP = game:service'UserInputService'
  165. local target = nil;
  166. local TweS = game:GetService("TweenService")
  167.  
  168. --[[Limbs and Extra Calls]]--
  169. local Gui,Frame,Ammo,Stored,Mode,Slash,HitM = nil,nil,nil,nil,nil,nil,nil
  170. local ra,la,ts,hd,ll,rl,root,humanoid = Char:FindFirstChild'Right Arm',Char:FindFirstChild'Left Arm',Char:FindFirstChild'Torso',Char:FindFirstChild'Head',Char:FindFirstChild'Left Leg',Char:FindFirstChild'Right Leg',Char:FindFirstChild'HumanoidRootPart',Char:FindFirstChild'Humanoid'
  171. local rarm,larm,hed,torso,hroot,lleg,hum,rleg = ra,la,hd,ts,root,ll,humanoid,rl
  172. local plr,char,mouse = Plr,Char,Mouse
  173. local AbleToShoot,Reloading = true,false
  174. local Stance = 'Standing'
  175.  
  176. Weld = function(P0,P1,CF)
  177. local W = Instance.new('Weld',P1)
  178. W.Part0 = P0
  179. W.Part1 = P1
  180. W.C1 = CF
  181. return W
  182. end;
  183.  
  184. NewSound = function(Parent, Id)
  185. local Sound = Instance.new('Sound',Parent)
  186. Sound.SoundId = 'rbxassetid://'..Id
  187. return Sound
  188. end
  189.  
  190. rad = function(Int)
  191. return math.rad(tonumber(Int))
  192. end;
  193. sin = function(Int)
  194. return math.sin(tonumber(Int))
  195. end;
  196. cos = function(Int)
  197. return math.cos(tonumber(Int))
  198. end;
  199. Angles = function(X,Y,Z)
  200. return CFrame.Angles(X,Y,Z);
  201. end;
  202. Euler = function(X,Y,Z)
  203. return CFrame.fromEulerAnglesXYZ(X,Y,Z);
  204. end;
  205. CF = function(X,Y,Z)
  206. return CFrame.new(X,Y,Z);
  207. end;
  208.  
  209. New = function(Object, Parent, Name, Data)
  210. local Object = Instance.new(Object)
  211. if Object:IsA'Part' then
  212. Object.Anchored = false
  213. Object.CanCollide = false
  214. Object.Locked = true
  215. Object.TopSurface,Object.BottomSurface = 10,10
  216. Object.RightSurface,Object.LeftSurface = 10,10
  217. Object.FrontSurface,Object.BackSurface = 10,10
  218. end
  219. for Index, Value in pairs(Data or {}) do
  220. Object[Index] = Value
  221. end
  222. Object.Parent = Parent
  223. Object.Name = Name
  224. return Object
  225. end
  226.  
  227. Newv2 = function(Object, Parent, Name, Data)
  228. local Object = Instance.new(Object)
  229. for Index, Value in pairs(Data or {}) do
  230. Object[Index] = Value
  231. end
  232. Object.Parent = Parent
  233. Object.Name = Name
  234. return Object
  235. end
  236.  
  237. local gun = Instance.new("Model", char)
  238.  
  239. local handle = Instance.new("Part", gun)
  240. handle.Size = Vector3.new(0.36, 1, 2)
  241. handle.CanCollide = false
  242.  
  243. local mesh = Instance.new("SpecialMesh", handle)
  244. mesh.MeshId = "rbxassetid://430346344"
  245. mesh.TextureId = "rbxassetid://430348267"
  246. mesh.Scale = Vector3.new(0.002, 0.002, 0.002)
  247.  
  248. GN = New("ManualWeld",handle,"Weld",{Part0 = handle,Part1 = rarm,C1 = CFrame.new(-0.174806952, -1.22873306, -0.288364887, -0.947384775, -0.162324503, 0.27588594, -0.269265532, -0.0619060546, -0.961074293, 0.173084974, -0.984793603, 0.0149404127),})
  249.  
  250.  
  251. local music = Instance.new("Sound", torso)
  252. music.Looped = true
  253. music.Volume = 3
  254. music.SoundId = "rbxassetid://1438408927"
  255. music:Play()
  256.  
  257. -- Objects
  258.  
  259. local glock18 = Instance.new("ScreenGui")
  260. local ammo1 = Instance.new("Frame")
  261. local TextLabel = Instance.new("TextLabel")
  262. local ammoy = Instance.new("TextLabel")
  263.  
  264. -- Properties
  265.  
  266. glock18.Name = "glock18"
  267. glock18.Parent = Plr.PlayerGui
  268.  
  269. ammo1.Name = "ammo1"
  270. ammo1.Parent = glock18
  271. ammo1.BackgroundColor3 = Color3.new(1, 1, 1)
  272. ammo1.Position = UDim2.new(0.987226248, -184, 0.970355749, -69)
  273. ammo1.Size = UDim2.new(0, 191, 0, 75)
  274. ammo1.Style = Enum.FrameStyle.RobloxRound
  275.  
  276. TextLabel.Parent = ammo1
  277. TextLabel.BackgroundColor3 = Color3.new(1, 1, 1)
  278. TextLabel.BackgroundTransparency = 1
  279. TextLabel.Position = UDim2.new(0.00523560215, 0, 0.0266666636, 0)
  280. TextLabel.Size = UDim2.new(0, 100, 0, 12)
  281. TextLabel.Font = Enum.Font.SourceSansBold
  282. TextLabel.Text = "Glock 18"
  283. TextLabel.TextColor3 = Color3.new(1, 1, 1)
  284. TextLabel.TextSize = 25
  285.  
  286. ammoy.Name = "ammo"
  287. ammoy.Parent = ammo1
  288. ammoy.BackgroundColor3 = Color3.new(1, 1, 1)
  289. ammoy.BackgroundTransparency = 1
  290. ammoy.Position = UDim2.new(0.497382194, -50, 0.646666646, -6)
  291. ammoy.Size = UDim2.new(0, 100, 0, 12)
  292. ammoy.Font = Enum.Font.SourceSansBold
  293. ammoy.Text = "Ammo: 20"
  294. ammoy.TextColor3 = Color3.new(1, 1, 1)
  295. ammoy.TextSize = 30
  296.  
  297. local CamModel = Instance.new('Model',workspace.CurrentCamera)
  298. CamModel.Name = Plr.Name
  299. Instance.new('Humanoid',CamModel)
  300. humanoid.Died:connect(function()
  301. CamModel:Destroy()
  302. Plr.CameraMode = 'Classic'
  303. game:service'UserInputService'.MouseIconEnabled = true
  304. end)
  305.  
  306. ypcall(function()
  307. Char.Shirt:Clone().Parent = CamModel
  308. end)
  309.  
  310. -------------------------------------------------------------
  311. local fRemington_Model = gun:Clone()---------------------------------
  312. fRemington_Model.Parent = CamModel-------------------------------------
  313. --fRemington_Model.Mag:Destroy()-----------------------------------------
  314. --fRemington_Model.Mag2:Destroy()----------------------------------------
  315. local fRemington_ModelW = Weld(handle,handle,CF(0,0,0))---
  316. for index,obj in next,fRemington_Model:children() do-------------------
  317. if obj:IsA'Part' then----------------------------------------
  318. obj.CanCollide = false---------------------------------------
  319. end;end;-----------------------------------------------------
  320. -------------------------------------------------------------
  321. local frarm = rarm:Clone()-----------------------------------
  322. frarm.CanCollide = false-------------------------------------
  323. frarm.FormFactor = 3-----------------------------------------
  324. frarm.Parent = CamModel--------------------------------------
  325. local frarmW = Weld(rarm,frarm,CF(0,0,0))--------------------
  326. -------------------------------------------------------------
  327. local flarm = larm:Clone()-----------------------------------
  328. flarm.CanCollide = false-------------------------------------
  329. flarm.FormFactor = 3-----------------------------------------
  330. flarm.Parent = CamModel--------------------------------------
  331. local flarmW = Weld(larm,flarm,CF(0,0,0))--------------------
  332. -------------------------------------------------------------
  333.  
  334. NewSound = function(Parent, Id)
  335. local Sound = Instance.new('Sound',Parent)
  336. Sound.SoundId = 'rbxassetid://'..Id
  337. return Sound
  338. end
  339.  
  340. local lRS = game:service'RunService'.RenderStepped
  341.  
  342.  
  343. local CFY = {N=CFrame.new,A=CFrame.Angles,fEA=CFrame.fromEulerAnglesXYZ}
  344. local V3Y = {N=Vector3.new}
  345. local MY = {C=math.cos,R=math.rad,S=math.sin,P=math.pi,RNG=math.random,MRS=math.randomseed,H=math.huge}
  346.  
  347.  
  348. local NewInstance = function(instance,parent,properties)
  349. local inst = Instance.new(instance,parent)
  350. if(properties)then
  351. for i,v in next, properties do
  352. pcall(function() inst[i] = v end)
  353. end
  354. end
  355. return inst;
  356. end
  357.  
  358.  
  359.  
  360. for _,v in next, hum:GetPlayingAnimationTracks() do
  361. v:Stop();
  362. end
  363.  
  364. pcall(game.Destroy,char:FindFirstChild'Animate')
  365. pcall(game.Destroy,hum:FindFirstChild'Animator')
  366.  
  367. local RunS = game:GetService("RunService")
  368.  
  369.  
  370.  
  371. function clerp(a, b, t)
  372. local qa = {
  373. QuaternionFromCFrame(a)
  374. }
  375. local qb = {
  376. QuaternionFromCFrame(b)
  377. }
  378. local ax, ay, az = a.x, a.y, a.z
  379. local bx, by, bz = b.x, b.y, b.z
  380. local _t = 1 - t
  381. return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t))
  382. end
  383. 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 m00 < m11 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. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  414. local xs, ys, zs = x + x, y + y, z + z
  415. local wx, wy, wz = w * xs, w * ys, w * zs
  416. local xx = x * xs
  417. local xy = x * ys-- Created by Nebula_Zorua aka Quil_Cyndaquil
  418. local xz = x * zs
  419. local yy = y * ys
  420. local yz = y * zs
  421. local zz = z * zs
  422. 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))
  423. end
  424. function QuaternionSlerp(a, b, t)
  425. local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4]
  426. local startInterp, finishInterp
  427. if cosTheta >= 1.0E-4 then
  428. if 1 - cosTheta > 1.0E-4 then
  429. local theta = math.acos(cosTheta)
  430. local invSinTheta = 1 / math.sin(theta)
  431. startInterp = math.sin((1 - t) * theta) * invSinTheta
  432. finishInterp = math.sin(t * theta) * invSinTheta
  433. else
  434. startInterp = 1 - t
  435. finishInterp = t
  436. end
  437. elseif 1 + cosTheta > 1.0E-4 then
  438. local theta = math.acos(-cosTheta)
  439. local invSinTheta = 1 / math.sin(theta)
  440. startInterp = math.sin((t - 1) * theta) * invSinTheta
  441. finishInterp = math.sin(t * theta) * invSinTheta
  442. else
  443. startInterp = t - 1
  444. finishInterp = t
  445. end
  446. 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
  447. end
  448.  
  449.  
  450. local Create = LoadLibrary("RbxUtility").Create
  451.  
  452.  
  453. CFuncs = {
  454. ["Part"] = {
  455. Create = function(Parent, Material, Reflectance, Transparency, BColor, Name, Size)
  456. local Part = Create("Part"){
  457. Parent = Parent,
  458. Reflectance = Reflectance,
  459. Transparency = Transparency,
  460. CanCollide = false,
  461. Locked = true,
  462. BrickColor = BrickColor.new(tostring(BColor)),
  463. Name = Name,
  464. Size = Size,
  465. Material = Material,
  466. }
  467. RemoveOutlines(Part)
  468. return Part
  469. end;
  470. };
  471.  
  472. ["Mesh"] = {
  473. Create = function(Mesh, Part, MeshType, MeshId, OffSet, Scale)
  474. local Msh = Create(Mesh){
  475. Parent = Part,
  476. Offset = OffSet,
  477. Scale = Scale,
  478. }
  479. if Mesh == "SpecialMesh" then
  480. Msh.MeshType = MeshType
  481. Msh.MeshId = MeshId
  482. end
  483. return Msh
  484. end;
  485. };
  486.  
  487. ["Mesh"] = {
  488. Create = function(Mesh, Part, MeshType, MeshId, OffSet, Scale)
  489. local Msh = Create(Mesh){
  490. Parent = Part,
  491. Offset = OffSet,
  492. Scale = Scale,
  493. }
  494. if Mesh == "SpecialMesh" then
  495. Msh.MeshType = MeshType
  496. Msh.MeshId = MeshId
  497. end
  498. return Msh
  499. end;
  500. };
  501.  
  502. ["Weld"] = {
  503. Create = function(Parent, Part0, Part1, C0, C1)
  504. local Weld = Create("Weld"){
  505. Parent = Parent,
  506. Part0 = Part0,
  507. Part1 = Part1,
  508. C0 = C0,
  509. C1 = C1,
  510. }
  511. return Weld
  512. end;
  513. };
  514.  
  515. ["Sound"] = {
  516. Create = function(id, par, vol, pit)
  517. coroutine.resume(coroutine.create(function()
  518. local S = Create("Sound"){
  519. Volume = vol,
  520. Pitch = pit or 1,
  521. SoundId = id,
  522. Parent = par or workspace,
  523. }
  524. wait()
  525. S:play()
  526. game:GetService("Debris"):AddItem(S, 6)
  527. end))
  528. end;
  529. };
  530.  
  531. ["ParticleEmitter"] = {
  532. Create = function(Parent, Color1, Color2, LightEmission, Size, Texture, Transparency, ZOffset, Accel, Drag, LockedToPart, VelocityInheritance, EmissionDirection, Enabled, LifeTime, Rate, Rotation, RotSpeed, Speed, VelocitySpread)
  533. local fp = Create("ParticleEmitter"){
  534. Parent = Parent,
  535. Color = ColorSequence.new(Color1, Color2),
  536. LightEmission = LightEmission,
  537. Size = Size,
  538. Texture = Texture,
  539. Transparency = Transparency,
  540. ZOffset = ZOffset,
  541. Acceleration = Accel,
  542. Drag = Drag,
  543. LockedToPart = LockedToPart,
  544. VelocityInheritance = VelocityInheritance,
  545. EmissionDirection = EmissionDirection,
  546. Enabled = Enabled,
  547. Lifetime = LifeTime,
  548. Rate = Rate,
  549. Rotation = Rotation,
  550. RotSpeed = RotSpeed,
  551. Speed = Speed,
  552. VelocitySpread = VelocitySpread,
  553. }
  554. return fp
  555. end;
  556. };
  557.  
  558. CreateTemplate = {
  559.  
  560. };
  561. }
  562.  
  563.  
  564.  
  565. -- Joints and Lerp
  566. local LS = NewInstance('Motor',char,{Part0=torso,Part1=larm,C0 = CFY.N(-1.5,0.5,0),C1 = CFY.N(0,.5,0)})
  567. local RS = NewInstance('Motor',char,{Part0=torso,Part1=rarm,C0 = CFY.N(1.5,0.5,0),C1 = CFY.N(0,.5,0)})
  568. local NK = NewInstance('Motor',char,{Part0=torso,Part1=head,C0 = CFY.N(0,1.5,0)})
  569. local LH = NewInstance('Motor',char,{Part0=torso,Part1=lleg,C0 = CFY.N(-.5,-1,0),C1 = CFY.N(0,1,0)})
  570. local RH = NewInstance('Motor',char,{Part0=torso,Part1=rleg,C0 = CFY.N(.5,-1,0),C1 = CFY.N(0,1,0)})
  571. local RJ = NewInstance('Motor',char,{Part0=root,Part1=torso})
  572.  
  573. -- Default C0s
  574. local LSD=LS.C0
  575. local RSD=RS.C0
  576. local HD=NK.C0
  577. local TD=RJ.C0
  578. local LHD=LH.C0
  579. local RHD=RH.C0
  580.  
  581. function fire(v)
  582.  
  583. local missile = Instance.new("Part")
  584.  
  585.  
  586.  
  587. local spawnPos = handle.Position
  588.  
  589.  
  590.  
  591. spawnPos = spawnPos + (v * 8)
  592.  
  593. missile.Position = spawnPos
  594. missile.Size = Vector3.new(1,1,1)
  595. missile.Velocity = v * 600
  596. missile.BrickColor = BrickColor.new(26)
  597. missile.Shape = 0
  598. missile.BottomSurface = 0
  599. missile.TopSurface = 0
  600. missile.Name = "Bullet"
  601. missile.Elasticity = 0
  602. missile.Reflectance = 0
  603. missile.Friction = .9
  604. missile.CanCollide = false
  605.  
  606. local force = Instance.new("BodyForce")
  607. force.force = Vector3.new(0,missile:getMass() * 196,0)
  608. force.Parent = missile
  609.  
  610. local mesh = Instance.new("SpecialMesh")
  611. mesh.Scale = Vector3.new(.01,.01,.01)
  612. mesh.MeshType = "Sphere"
  613. mesh.Parent = missile
  614.  
  615. function onTouched(part)
  616. local h = part.Parent:findFirstChild("Humanoid")
  617. if h~=nil then
  618. h.Health = h.Health -100
  619. wait(.01)
  620. h.Health = h.Health -100
  621. wait(.01)
  622.  
  623. end
  624. end
  625.  
  626. missile.Touched:connect(onTouched)
  627.  
  628. local creator_tag = Instance.new("ObjectValue")
  629. creator_tag.Value = char
  630. creator_tag.Name = "creator"
  631. creator_tag.Parent = missile
  632.  
  633.  
  634.  
  635. missile.Parent = game.Workspace
  636.  
  637. end
  638.  
  639. function fadein()
  640. Plr.CameraMode = "LockFirstPerson"
  641. attack = true
  642. defAnim = false
  643. CFuncs["Sound"].Create("rbxassetid://169799883", torso, 3, 1)
  644. for i = 0, 2, 0.3 do
  645. RunS.RenderStepped:wait()
  646. LS.C0 = clerp(LS.C0,CFrame.new(-0.657111883, -0.430512428, -1.02956259, 0.567150056, -0.822405338, -0.0446111783, 0.552519441, 0.420081109, -0.719898462, 0.610788763, 0.383641958, 0.69264406),0.3)
  647. RS.C0 = clerp(RS.C0,CFrame.new(1.35287654, 0.0391665399, -0.429004192, 0.969914317, 0.243446648, 0, -0.178186312, 0.709911048, -0.681377888, -0.16587919, 0.660878181, 0.731931746),0.3)
  648. GN.C0 = clerp(GN.C0,CFrame.new(-0.0983841419, -1.10394311, -0.300000668, -0.934357166, 3.7252903e-08, 0.356337726, -0.356337696, -2.98023224e-08, -0.934357166, 1.86264515e-08, -0.99999994, -2.98023224e-08),0)
  649. end
  650. for i = 0, 2, 0.3 do
  651. RunS.RenderStepped:wait()
  652. LS.C0 = clerp(LS.C0,CFrame.new(0.158522338, 0.240668699, -0.936709285, 0.560309589, -0.623040736, 0.545777678, 0.481338233, -0.291315228, -0.826709569, 0.674067199, 0.725917041, 0.136666611),0.3)
  653. RS.C0 = clerp(RS.C0,CFrame.new(1.38027406, 0.218288228, -0.461218596, 0.969914317, 0.102011092, -0.221043006, -0.178186312, -0.321199805, -0.930096924, -0.16587919, 0.941501141, -0.29335928),0.3)
  654. GN.C0 = clerp(GN.C0,CFrame.new(-0.130455613, -1.16951847, -0.264689922, -0.913215518, -0.197638273, 0.356337786, -0.348274857, -0.0753737688, -0.934357226, 0.211523324, -0.977372885, 0),0)
  655. end
  656. for i = 0, 2, 0.3 do
  657. RunS.RenderStepped:wait()
  658. LS.C0 = clerp(LS.C0,CFrame.new(0.161980867, 0.32328704, -1.15545988, 0.859711528, -0.508263111, 0.0506423712, 0.113255493, 0.0930056944, -0.989203155, 0.498065472, 0.856164932, 0.137521684),0.3)
  659. RS.C0 = clerp(RS.C0,CFrame.new(1.38027394, 0.218288094, -0.461218745, 0.969914317, 0.167082101, -0.17705889, -0.178186312, -0.00834101345, -0.983961403, -0.16587919, 0.985907733, 0.0216816962),0.3)
  660. GN.C0 = clerp(GN.C0,CFrame.new(-0.174806952, -1.22873306, -0.288364649, -0.947384775, -0.162324503, 0.27588594, -0.269265532, -0.0619060546, -0.961074293, 0.173084974, -0.984793603, 0.0149404127),0)
  661. end
  662. for i = 0, 2, 0.3 do
  663. RunS.RenderStepped:wait()
  664. LS.C0 = clerp(LS.C0,CFrame.new(0.161980867, 0.32328704, -1.15545988, 0.859711528, -0.508263111, 0.0506423712, 0.113255493, 0.0930056944, -0.989203155, 0.498065472, 0.856164932, 0.137521684),0.3)
  665. RS.C0 = clerp(RS.C0,CFrame.new(1.38027394, 0.218288094, -0.461218745, 0.969914317, 0.167082101, -0.17705889, -0.178186312, -0.00834101345, -0.983961403, -0.16587919, 0.985907733, 0.0216816962),0.3)
  666. GN.C0 = clerp(GN.C0,CFrame.new(-0.174806952, -1.22873306, -0.288364649, -0.947384775, -0.162324503, 0.27588594, -0.269265532, -0.0619060546, -0.961074293, 0.173084974, -0.984793603, 0.0149404127),0)
  667. end
  668. attack = false
  669. defAnim = true
  670. end
  671.  
  672. function inspect()
  673. attack = true
  674. defAnim = false
  675. for i = 0, 2, 0.3 do
  676. RunS.RenderStepped:wait()
  677. LS.C0 = clerp(LS.C0,CFrame.new(0.161980867, 0.323287517, -1.15545988, 0.859711528, -0.508263111, 0.0506423712, 0.113255493, 0.0930056944, -0.989203155, 0.498065472, 0.856164932, 0.137521684),0.3)
  678. RS.C0 = clerp(RS.C0,CFrame.new(1.38027394, 0.218288332, -0.461218745, 0.969914317, 0.167082101, -0.17705889, -0.178186312, -0.00834101345, -0.983961403, -0.16587919, 0.985907733, 0.0216816962),0.3)
  679. GN.C0 = clerp(GN.C0,CFrame.new(-0.174806952, -1.22873306, -0.288364887, -0.947384775, -0.162324503, 0.27588594, -0.269265532, -0.0619060546, -0.961074293, 0.173084974, -0.984793603, 0.0149404127),0)
  680.  
  681. RJ.C0 = clerp(RJ.C0,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),0.3)
  682. end
  683.  
  684. CFuncs["Sound"].Create("rbxassetid://921796477", torso, 3, 1)
  685. for i = 0, 2, 0.3 do
  686. RunS.RenderStepped:wait()
  687. LS.C0 = clerp(LS.C0,CFrame.new(-1.23224425, 0.449829996, -0.233818352, 0.960404813, 0.276607126, 0.033331804, -0.0890999958, 0.418289512, -0.903932989, -0.263976663, 0.86517179, 0.426372975),0.3)
  688. RS.C0 = clerp(RS.C0,CFrame.new(0.962285638, 0.115449607, -1.15711117, 0.770475388, 0.514442205, -0.376453102, -0.152283132, -0.424910188, -0.89233464, -0.619013369, 0.744849324, -0.2490419),0.3)
  689. GN.C0 = clerp(GN.C0,CFrame.new(-0.272401094, -1.15437603, -0.2704283, -0.965247095, -0.162324473, -0.204814732, 0.217120826, -0.0619060844, -0.974179745, 0.145454109, -0.984793484, 0.0949986428),0)
  690. end
  691. wait(2)
  692. for i = 0, 2, 0.3 do
  693. RunS.RenderStepped:wait()
  694. LS.C0 = clerp(LS.C0,CFrame.new(-1.23224401, 0.449829906, -0.23381862, 0.960404813, 0.271986961, 0.0603788979, -0.0890999958, 0.5051772, -0.858403683, -0.263976663, 0.819035351, 0.509408712),0.3)
  695. RS.C0 = clerp(RS.C0,CFrame.new(1.10590088, 0.30951947, -1.14559174, 0.728411317, 0.514442205, 0.452511042, 0.674886405, -0.424910188, -0.603307188, -0.118090212, 0.744849324, -0.656699419),0.3)
  696. GN.C0 = clerp(GN.C0,CFrame.new(-0.229920149, -1.17744732, -0.275511265, -0.985279143, -0.168420613, -0.0293153897, 0.0400875434, -0.0609193742, -0.997337341, 0.166186094, -0.983830929, 0.0667740405),0)
  697. end
  698. wait(2)
  699. for i = 0, 2, 0.3 do
  700. RunS.RenderStepped:wait()
  701. LS.C0 = clerp(LS.C0,CFrame.new(0.161980867, 0.323287517, -1.15545988, 0.859711528, -0.508263111, 0.0506423712, 0.113255493, 0.0930056944, -0.989203155, 0.498065472, 0.856164932, 0.137521684),0.3)
  702. RS.C0 = clerp(RS.C0,CFrame.new(1.38027394, 0.218288332, -0.461218745, 0.969914317, 0.167082101, -0.17705889, -0.178186312, -0.00834101345, -0.983961403, -0.16587919, 0.985907733, 0.0216816962),0.3)
  703. GN.C0 = clerp(GN.C0,CFrame.new(-0.174806952, -1.22873306, -0.288364887, -0.947384775, -0.162324503, 0.27588594, -0.269265532, -0.0619060546, -0.961074293, 0.173084974, -0.984793603, 0.0149404127),0)
  704. end
  705. for i = 0, 2, 0.3 do
  706. RunS.RenderStepped:wait()
  707. LS.C0 = clerp(LS.C0,CFrame.new(0.161980867, 0.323287517, -1.15545988, 0.859711528, -0.508263111, 0.0506423712, 0.113255493, 0.0930056944, -0.989203155, 0.498065472, 0.856164932, 0.137521684),0.3)
  708. RS.C0 = clerp(RS.C0,CFrame.new(1.38027394, 0.218288332, -0.461218745, 0.969914317, 0.167082101, -0.17705889, -0.178186312, -0.00834101345, -0.983961403, -0.16587919, 0.985907733, 0.0216816962),0.3)
  709. GN.C0 = clerp(GN.C0,CFrame.new(-0.174806952, -1.22873306, -0.288364887, -0.947384775, -0.162324503, 0.27588594, -0.269265532, -0.0619060546, -0.961074293, 0.173084974, -0.984793603, 0.0149404127),0)
  710. end
  711. attack = false
  712. defAnim = true
  713. end
  714.  
  715. local Scale = game.Players.LocalPlayer.Character.Torso.Size.X/2*(game.Players.LocalPlayer.Character.Torso:FindFirstChild("ScaleInserted") ~= nil and game.Players.LocalPlayer.Character.Torso:FindFirstChild("ScaleInserted").Scale.Z or 1)*0.8
  716.  
  717. function shoot()
  718. attack = true
  719. defAnim = false
  720. for i = 0, 2, 0.4 do
  721. RunS.RenderStepped:wait()
  722. LS.C0 = clerp(LS.C0,CFrame.new(0.161980242, 0.323287547, -1.1554594, 0.859711528, -0.439796269, 0.259759933, 0.113255493, -0.331763655, -0.936539233, 0.498065472, 0.834572911, -0.235411704),0.3)
  723. RS.C0 = clerp(RS.C0,CFrame.new(1.38027406, 0.218288302, -0.461218804, 0.969914317, 0.102551512, -0.2207928, -0.178186312, -0.318923712, -0.930879831, -0.16587919, 0.942215979, -0.291055381),0.3)
  724. GN.C0 = clerp(GN.C0,CFrame.new(-0.174806833, -1.22873306, -0.288364887, -0.947384775, -0.189287007, 0.258133173, -0.269265532, 0.0352107882, -0.962422252, 0.173084959, -0.981290221, -0.0843266249),0)
  725. end
  726. ammo = ammo -1
  727.  
  728. if head == true then char.Head:BreakJoints() return end
  729. coroutine.resume(coroutine.create(function()
  730. for _,v in pairs (Mouse.Target.Parent:children()) do
  731. if v:IsA("Humanoid") then v.Health = v.Health - 15 end
  732. end
  733. end))
  734.  
  735. local Shell = Instance.new("Part",workspace)
  736. Shell.FormFactor = "Custom"
  737. Shell.BrickColor = BrickColor.new("Bright yellow")
  738. Shell.Size = Vector3.new(0.2,0.5,0.2)*Scale
  739. Shell.CFrame = handle.CFrame*CFrame.new(0.5,0.5,0)*CFrame.Angles(math.rad(-90),0,0)
  740. Shell.Velocity = ((handle.CFrame*CFrame.new(5,0,math.random(-2,2))).p-handle.CFrame.p)*5*Scale
  741. local Mesh = Instance.new("CylinderMesh",Shell)
  742. Mesh.Scale = Vector3.new(0.2,0.5,0.2)*Scale/Shell.Size
  743. spawn(function()
  744. wait(5)
  745. Shell:Destroy()
  746. end)
  747.  
  748. CFuncs["Sound"].Create("rbxassetid://165946426", torso, 2, 1)
  749. for i = 0, 2, 0.4 do
  750. RunS.RenderStepped:wait()
  751. LS.C0 = clerp(LS.C0,CFrame.new(0.161980242, 0.323287547, -1.1554594, 0.859711528, -0.439796269, 0.259759933, 0.113255493, -0.331763655, -0.936539233, 0.498065472, 0.834572911, -0.235411704),0.3)
  752. RS.C0 = clerp(RS.C0,CFrame.new(1.38027406, 0.218288302, -0.461218804, 0.969914317, 0.102551512, -0.2207928, -0.178186312, -0.318923712, -0.930879831, -0.16587919, 0.942215979, -0.291055381),0.3)
  753. GN.C0 = clerp(GN.C0,CFrame.new(-0.174806833, -1.22873306, -0.288364887, -0.947384775, -0.189287007, 0.258133173, -0.269265532, 0.0352107882, -0.962422252, 0.173084959, -0.981290221, -0.0843266249),0)
  754. end
  755. attack = false
  756. defAnim = true
  757. end
  758.  
  759. function reload()
  760. attack = true
  761. defAnim = false
  762. for i = 0, 2, 0.3 do
  763. RunS.RenderStepped:wait()
  764. LS.C0 = clerp(LS.C0,CFrame.new(0.161980867, 0.323287278, -1.15545988, 0.859711528, -0.508263111, 0.0506423712, 0.113255493, 0.0930056944, -0.989203155, 0.498065472, 0.856164932, 0.137521684),0.3)
  765. RS.C0 = clerp(RS.C0,CFrame.new(1.38027394, 0.218288332, -0.461218745, 0.969914317, 0.167082101, -0.17705889, -0.178186312, -0.00834101345, -0.983961403, -0.16587919, 0.985907733, 0.0216816962),0.3)
  766. GN.C0 = clerp(GN.C0,CFrame.new(-0.174806952, -1.22873306, -0.288364887, -0.947384775, -0.162324503, 0.27588594, -0.269265532, -0.0619060546, -0.961074293, 0.173084974, -0.984793603, 0.0149404127),0)
  767. end
  768. CFuncs["Sound"].Create("rbxassetid://269172810", torso, 2, 1)
  769. wait(0.1)
  770. for i = 0, 2, 0.3 do
  771. RunS.RenderStepped:wait()
  772. LS.C0 = clerp(LS.C0,CFrame.new(-1.17278111, 0.48222062, -0.471188039, 0.924792349, 0.150494352, 0.349443197, -0.256053537, 0.925508916, 0.279051423, -0.281417072, -0.347540796, 0.894438148),0.3)
  773. RS.C0 = clerp(RS.C0,CFrame.new(1.03868747, 0.263712585, -1.18925571, 0.875781119, 0.449063241, -0.17705889, -0.167567432, -0.0611644834, -0.983961403, -0.452690601, 0.891404033, 0.0216816962),0.3)
  774. GN.C0 = clerp(GN.C0,CFrame.new(-0.542592764, -1.10347652, -0.254355431, -0.715370178, -0.0529403165, -0.696737707, 0.693933368, -0.170653373, -0.699524164, -0.081867516, -0.983907878, 0.15881744),0)
  775. end
  776. wait(0.1)
  777. for i = 0, 2, 0.3 do
  778. RunS.RenderStepped:wait()
  779. LS.C0 = clerp(LS.C0,CFrame.new(-0.568064034, 0.204982013, -1.42027211, 0.622793555, -0.769848466, -0.139505237, -0.00457992731, 0.174716875, -0.984607935, 0.782372713, 0.613846302, 0.105286777),0.3)
  780. RS.C0 = clerp(RS.C0,CFrame.new(1.03868735, 0.263712615, -1.18925524, 0.875781119, 0.467157662, -0.121537626, -0.167567432, 0.0580991954, -0.984147191, -0.452690601, 0.882263184, 0.129162595),0.3)
  781. GN.C0 = clerp(GN.C0,CFrame.new(0.0538945198, -1.14835835, -0.169887543, -0.973866582, -0.0529403463, 0.220865563, -0.209099188, -0.170653418, -0.962888956, 0.0886671841, -0.983907938, 0.155123785),0)
  782. end
  783. wait(0.2)
  784. for i = 0, 2, 0.3 do
  785. RunS.RenderStepped:wait()
  786. LS.C0 = clerp(LS.C0,CFrame.new(-0.490309298, 0.710055947, -1.4792105, 0.622793555, -0.625803113, 0.469572961, -0.00457992731, -0.603086174, -0.797662675, 0.782372713, 0.494628578, -0.378464222),0.3)
  787. RS.C0 = clerp(RS.C0,CFrame.new(1.03868747, 0.263712704, -1.18925595, 0.875781119, 0.379022956, -0.298913509, -0.167567432, -0.342017978, -0.924632311, -0.452690601, 0.859863639, -0.236020967),0.3)
  788. GN.C0 = clerp(GN.C0,CFrame.new(0.0524652004, -0.946891785, -0.204425573, -0.997490406, -0.0683014616, -0.0186621845, 0.0205418169, -0.0269232988, -0.999426544, 0.0677600279, -0.99730134, 0.0282589048),0)
  789. end
  790.  
  791. -- shell
  792. ammo = 20
  793. local Shell = Instance.new("Part",workspace)
  794. Shell.FormFactor = "Custom"
  795. Shell.BrickColor = BrickColor.new("Bright yellow")
  796. Shell.Size = Vector3.new(0.2,0.5,0.2)*Scale
  797. Shell.CFrame = handle.CFrame*CFrame.new(0.5,0.5,0)*CFrame.Angles(math.rad(-90),0,0)
  798. Shell.Velocity = ((handle.CFrame*CFrame.new(5,0,math.random(-2,2))).p-handle.CFrame.p)*5*Scale
  799. local Mesh = Instance.new("CylinderMesh",Shell)
  800. Mesh.Scale = Vector3.new(0.2,0.5,0.2)*Scale/Shell.Size
  801. spawn(function()
  802. wait(5)
  803. Shell:Destroy()
  804. end)
  805.  
  806.  
  807. for i = 0, 2, 0.3 do
  808. RunS.RenderStepped:wait()
  809. LS.C0 = clerp(LS.C0,CFrame.new(-0.186799586, 0.73579663, -1.16131508, 0.551755011, -0.753234982, 0.358055115, -0.0496432446, -0.458220094, -0.887451172, 0.832527339, 0.471880645, -0.290218115),0.3)
  810. RS.C0 = clerp(RS.C0,CFrame.new(1.03868747, 0.263712704, -1.18925595, 0.875781119, 0.379022956, -0.298913509, -0.167567432, -0.342017978, -0.924632311, -0.452690601, 0.859863639, -0.236020967),0.3)
  811. GN.C0 = clerp(GN.C0,CFrame.new(0.0524652004, -0.946891785, -0.204425573, -0.997490406, -0.0683014616, -0.0186621845, 0.0205418169, -0.0269232988, -0.999426544, 0.0677600279, -0.99730134, 0.0282589048),0)
  812. end
  813.  
  814. -- there goes to shell
  815.  
  816.  
  817.  
  818.  
  819. for i = 0, 2, 0.3 do
  820. RunS.RenderStepped:wait()
  821. LS.C0 = clerp(LS.C0,CFrame.new(-0.25933069, 0.792986512, -1.42567968, 0.657083452, -0.621070743, 0.427214861, 0.018668605, -0.553153694, -0.832869828, 0.753586531, 0.555240512, -0.351873457),0.3)
  822. RS.C0 = clerp(RS.C0,CFrame.new(1.03868747, 0.263712525, -1.18925548, 0.875781119, 0.401792049, -0.267527282, -0.167567432, -0.2667, -0.949100792, -0.452690601, 0.876033366, -0.166243568),0.3)
  823. GN.C0 = clerp(GN.C0,CFrame.new(0.0524654388, -0.946891785, -0.204425454, -0.997490346, -0.0683014765, -0.0186622441, 0.0205417871, -0.0269232988, -0.999426603, 0.0677600205, -0.997301459, 0.0282589123),0)
  824. end
  825. RunS.RenderStepped:wait()
  826. LS.C0 = clerp(LS.C0,CFrame.new(0.161980867, 0.323287278, -1.15545988, 0.859711528, -0.508263111, 0.0506423712, 0.113255493, 0.0930056944, -0.989203155, 0.498065472, 0.856164932, 0.137521684),0.3)
  827. RS.C0 = clerp(RS.C0,CFrame.new(1.38027394, 0.218288332, -0.461218745, 0.969914317, 0.167082101, -0.17705889, -0.178186312, -0.00834101345, -0.983961403, -0.16587919, 0.985907733, 0.0216816962),0.3)
  828. GN.C0 = clerp(GN.C0,CFrame.new(-0.174806952, -1.22873306, -0.288364887, -0.947384775, -0.162324503, 0.27588594, -0.269265532, -0.0619060546, -0.961074293, 0.173084974, -0.984793603, 0.0149404127),0)
  829. for i = 0, 2, 0.3 do
  830. RunS.RenderStepped:wait()
  831. LS.C0 = clerp(LS.C0,CFrame.new(0.161980867, 0.323287278, -1.15545988, 0.859711528, -0.508263111, 0.0506423712, 0.113255493, 0.0930056944, -0.989203155, 0.498065472, 0.856164932, 0.137521684),0.3)
  832. RS.C0 = clerp(RS.C0,CFrame.new(1.38027394, 0.218288332, -0.461218745, 0.969914317, 0.167082101, -0.17705889, -0.178186312, -0.00834101345, -0.983961403, -0.16587919, 0.985907733, 0.0216816962),0.3)
  833. GN.C0 = clerp(GN.C0,CFrame.new(-0.174806952, -1.22873306, -0.288364887, -0.947384775, -0.162324503, 0.27588594, -0.269265532, -0.0619060546, -0.961074293, 0.173084974, -0.984793603, 0.0149404127),0)
  834. end
  835. attack = false
  836. defAnim = true
  837. end
  838. function CheckState(rPart)
  839. if(rPart.Velocity.y > .5 and hum:GetState() == Enum.HumanoidStateType.Freefall)then
  840. return 'Jump';
  841. elseif(rPart.Velocity.y < -.5 and hum:GetState() == Enum.HumanoidStateType.Freefall)then
  842. return 'Fall';
  843. elseif(math.abs(rPart.Velocity.x) > 2 or math.abs(rPart.Velocity.z) > 2 and hum:GetState() ~= Enum.HumanoidStateType.Freefall)then
  844. return 'Walk';
  845. end
  846. return 'Idle';
  847. end
  848.  
  849. fadein()
  850.  
  851. mouse.Button1Down:connect(function()
  852. if attack == false then
  853. if ammo ~= 0 then
  854. shoot()
  855. end
  856. end
  857. end)
  858.  
  859. mouse.KeyDown:connect(function(k)
  860. k = k:lower()
  861. if attack == false and k == 'r' then
  862. if ammo ~= 20 then
  863. reload()
  864. end
  865. end
  866. if attack == false and k == 'f' then
  867. inspect()
  868. end
  869. end)
  870.  
  871. Char.Animate:Destroy()
  872.  
  873. RunS:BindToRenderStep("N_Animations",Enum.RenderPriority.Character.Value + 1,function()
  874. if ammo ~= 0 then
  875. ammoy.Text = "Ammo: "..ammo
  876. else
  877. ammoy.Text = "Ran out ammo"
  878. end
  879.  
  880. sine=sine+change
  881. if(target and not target.Parent) then
  882. target = nil;
  883. end
  884. if(target)then
  885.  
  886.  
  887. else
  888.  
  889. end
  890.  
  891. if(defAnim)then
  892. if(CheckState(root) == 'Idle')then
  893. -- Idle anim
  894. change = .4
  895.  
  896. for i = 0, 2, 1.5 do
  897. RunS.RenderStepped:wait()
  898.  
  899. LH.C0 = clerp(LH.C0,CFrame.new(-0.5, -1, 0, 1, 0, 0, 0, 0.99999994, 0, 0, 0, 1),0.3)
  900. RH.C0 = clerp(RH.C0,CFrame.new(0.5, -1, 0, 1, 0, 0, 0, 0.99999994, 0, 0, 0, 1),0.3)
  901. LS.C0 = clerp(LS.C0,CFrame.new(0.161980867, 0.323287278, -1.15545988, 0.859711528, -0.508263111, 0.0506423712, 0.113255493, 0.0930056944, -0.989203155, 0.498065472, 0.856164932, 0.137521684),0.3)
  902. RS.C0 = clerp(RS.C0,CFrame.new(1.38027394, 0.218288332, -0.461218745, 0.969914317, 0.167082101, -0.17705889, -0.178186312, -0.00834101345, -0.983961403, -0.16587919, 0.985907733, 0.0216816962),0.3)
  903. GN.C0 = clerp(GN.C0,CFrame.new(-0.174806952, -1.22873306, -0.288364887, -0.947384775, -0.162324503, 0.27588594, -0.269265532, -0.0619060546, -0.961074293, 0.173084974, -0.984793603, 0.0149404127),0)
  904. RJ.C0 = clerp(RJ.C0,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),0.3)
  905. end
  906.  
  907. elseif(CheckState(root) == 'Walk')then
  908.  
  909. for i = 0, 2, 1.5 do
  910. RunS.RenderStepped:wait()
  911. LS.C0 = clerp(LS.C0,CFrame.new(0.161980867, 0.323287278, -1.15545988, 0.859711528, -0.508263111, 0.0506423712, 0.113255493, 0.0930056944, -0.989203155, 0.498065472, 0.856164932, 0.137521684),0.3)
  912. RS.C0 = clerp(RS.C0,CFrame.new(1.38027394, 0.218288332, -0.461218745, 0.969914317, 0.167082101, -0.17705889, -0.178186312, -0.00834101345, -0.983961403, -0.16587919, 0.985907733, 0.0216816962),0.3)
  913. GN.C0 = clerp(GN.C0,CFrame.new(-0.174806952, -1.22873306, -0.288364887, -0.947384775, -0.162324503, 0.27588594, -0.269265532, -0.0619060546, -0.961074293, 0.173084974, -0.984793603, 0.0149404127),0)
  914. RJ.C0 = clerp(RJ.C0,TD * CFY.N(0,-.175 + .025 * MY.C(sine / 3.5) + -MY.S(sine/3.5)/7,0) *CFY.A(-MY.R(5-2.5*MY.C(sine/3.5)),-MY.R(10 * MY.C(sine / 7)),0),.2)
  915.  
  916.  
  917.  
  918. LH.C0 = clerp(LH.C0,CFY.N(-.5, -0.925 + 0.5 * MY.C(sine / 7) / 2, -0.5 * MY.C(sine / 7) / 2) * CFY.A(MY.R(-15 + 15 * MY.C(sine / 7)) + MY.S(sine / 7) / 2.5, MY.R(10 * MY.C(sine / 7)), MY.R(0)) * CFY.A(MY.R(0 - 2.5 * MY.C(sine / 7)), MY.R(0), MY.R(0)),.2)
  919. RH.C0 = clerp(RH.C0,CFY.N(.5, -0.925 - 0.5 * MY.C(sine / 7) / 2, 0.5 * MY.C(sine / 7) / 2) * CFY.A(MY.R(-15 - 15 * MY.C(sine / 7)) + -MY.S(sine / 7) / 2.5, MY.R(10 * MY.C(sine / 7)), MY.R(0)) * CFY.A(MY.R(0 + 2.5 * MY.C(sine / 7)), MY.R(0), MY.R(0)),.2)
  920.  
  921.  
  922. end
  923.  
  924. elseif(CheckState(root) == 'Jump')then
  925.  
  926. for i = 0, 2, 1.5 do
  927. RunS.RenderStepped:wait()
  928. LS.C0 = clerp(LS.C0,CFrame.new(0.161980867, 0.323287278, -1.15545988, 0.859711528, -0.508263111, 0.0506423712, 0.113255493, 0.0930056944, -0.989203155, 0.498065472, 0.856164932, 0.137521684),0.3)
  929. RS.C0 = clerp(RS.C0,CFrame.new(1.38027394, 0.218288332, -0.461218745, 0.969914317, 0.167082101, -0.17705889, -0.178186312, -0.00834101345, -0.983961403, -0.16587919, 0.985907733, 0.0216816962),0.3)
  930. GN.C0 = clerp(GN.C0,CFrame.new(-0.174806952, -1.22873306, -0.288364887, -0.947384775, -0.162324503, 0.27588594, -0.269265532, -0.0619060546, -0.961074293, 0.173084974, -0.984793603, 0.0149404127),0)
  931. RJ.C0 = clerp(RJ.C0,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),0.3)
  932. end
  933.  
  934. elseif(CheckState(root) == 'Fall')then
  935.  
  936. for i = 0, 2, 1.5 do
  937. RunS.RenderStepped:wait()
  938. LS.C0 = clerp(LS.C0,CFrame.new(0.161980867, 0.323287278, -1.15545988, 0.859711528, -0.508263111, 0.0506423712, 0.113255493, 0.0930056944, -0.989203155, 0.498065472, 0.856164932, 0.137521684),0.3)
  939. RS.C0 = clerp(RS.C0,CFrame.new(1.38027394, 0.218288332, -0.461218745, 0.969914317, 0.167082101, -0.17705889, -0.178186312, -0.00834101345, -0.983961403, -0.16587919, 0.985907733, 0.0216816962),0.3)
  940. GN.C0 = clerp(GN.C0,CFrame.new(-0.174806952, -1.22873306, -0.288364887, -0.947384775, -0.162324503, 0.27588594, -0.269265532, -0.0619060546, -0.961074293, 0.173084974, -0.984793603, 0.0149404127),0)
  941. RJ.C0 = clerp(RJ.C0,CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),0.3)
  942. end
  943.  
  944. end
  945. end
  946. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement