Advertisement
Scripteditor233

gun 3 (FPS)

Oct 20th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 61.77 KB | None | 0 0
  1. --[[ FPS M1911 by KillerDarkness0105/Codex#6685]]--
  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")
  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.  
  69. local Mouse = Player:GetMouse()
  70. local UIS = game:GetService("UserInputService")
  71. local input = function(io,a)
  72. if a then return end
  73. --Since InputObject is a client-side instance, we create and pass table instead
  74. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  75. end
  76. UIS.InputBegan:Connect(input)
  77. UIS.InputEnded:Connect(input)
  78.  
  79. local h,t
  80. --Give the server mouse data 30 times every second, but only if the values changed
  81. --If player is not moving their mouse, client won't fire events
  82. while wait(1/30) do
  83. if h~=Mouse.Hit or t~=Mouse.Target then
  84. h,t=Mouse.Hit,Mouse.Target
  85. Event:FireServer({isMouse=true,Target=t,Hit=h})
  86. end
  87. end]==],Player.Character)
  88.  
  89. ----Sandboxed game object that allows the usage of client-side methods and services
  90. --Real game object
  91. local _rg = game
  92.  
  93. --Metatable for fake service
  94. local fsmt = {
  95. __index = function(self,k)
  96. local s = rawget(self,"_RealService")
  97. if s then
  98. return typeof(s[k])=="function"
  99. and function(_,...)return s[k](s,...)end or s[k]
  100. end
  101. end,
  102. __newindex = function(self,k,v)
  103. local s = rawget(self,"_RealService")
  104. if s then s[k]=v end
  105. end
  106. }
  107. local function FakeService(t,RealService)
  108. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  109. return setmetatable(t,fsmt)
  110. end
  111.  
  112. --Fake game object
  113. local g = {
  114. GetService = function(self,s)
  115. return rawget(self,s) or _rg:GetService(s)
  116. end,
  117. Players = FakeService({
  118. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  119. },"Players"),
  120. UserInputService = FakeService(UIS,"UserInputService"),
  121. ContextActionService = FakeService(CAS,"ContextActionService"),
  122. RunService = FakeService({
  123. _btrs = {},
  124. RenderStepped = _rg:GetService("RunService").Heartbeat,
  125. BindToRenderStep = function(self,name,_,fun)
  126. self._btrs[name] = self.Heartbeat:Connect(fun)
  127. end,
  128. UnbindFromRenderStep = function(self,name)
  129. self._btrs[name]:Disconnect()
  130. end,
  131. },"RunService")
  132. }
  133. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  134. g.service = g.GetService
  135. FakeService(g,game)
  136. --Changing owner to fake player object to support owner:GetMouse()
  137. game,owner = g,g.Players.LocalPlayer
  138. end
  139. Player=game:GetService("Players").LocalPlayer
  140. Character=Player.Character
  141. PlayerGui=Player.PlayerGui
  142. Backpack=Player.Backpack
  143. Torso=Character.Torso
  144. Head=Character.Head
  145. Humanoid=Character.Humanoid
  146. LeftArm=Character["Left Arm"]
  147. LeftLeg=Character["Left Leg"]
  148. RightArm=Character["Right Arm"]
  149. RightLeg=Character["Right Leg"]
  150. LS=Torso["Left Shoulder"]
  151. LH=Torso["Left Hip"]
  152. RS=Torso["Right Shoulder"]
  153. RH=Torso["Right Hip"]
  154. Face = Head.face
  155. Neck=Torso.Neck
  156. it=Instance.new
  157. attacktype=1
  158. attacktype2=1
  159. vt=Vector3.new
  160. it=Instance.new
  161. cf=CFrame.new
  162. cn=CFrame.new
  163. euler=CFrame.fromEulerAnglesXYZ
  164. angles=CFrame.Angles
  165. necko=cf(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  166. necko2=cf(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  167. LHC0=cf(-1,-1,0,-0,-0,-1,0,1,0,1,0,0)
  168. LHC1=cf(-0.5,1,0,-0,-0,-1,0,1,0,1,0,0)
  169. RHC0=cf(1,-1,0,0,0,1,0,1,0,-1,-0,-0)
  170. RHC1=cf(0.5,1,0,0,0,1,0,1,0,-1,-0,-0)
  171. RootPart=Character.HumanoidRootPart
  172. RootJoint=RootPart.RootJoint
  173. RootCF=euler(-1.57,0,3.14)
  174. attack = false
  175. local Effects = {}
  176. attackspeed = 0.14
  177. df = false
  178. Swing = 1
  179. local sine = 0
  180. local change = 1
  181. local val = 0
  182. local speed = 0
  183. local rs = game:GetService("RunService").RenderStepped
  184. cam = workspace.CurrentCamera
  185. local RbxUtility = LoadLibrary("RbxUtility")
  186. local Create = RbxUtility.Create
  187. deb = game:GetService("Debris")
  188. Player.CameraMode = 1
  189. local aim = false
  190. mouse = Player:GetMouse()
  191.  
  192. local lerp = function(a, b, t)
  193. return a * (1 - t) + b * t
  194. end
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205. local accuracymain = Instance.new("ScreenGui", Player.PlayerGui)
  206.  
  207. accuracymain.Name = 'GunAccuracyFrame'
  208.  
  209. local accuracyFrame = Instance.new("Frame", accuracymain)
  210.  
  211. accuracyFrame.Size = UDim2.new(0, 30, 0, 30)
  212.  
  213. accuracyFrame.BackgroundTransparency = 1
  214.  
  215. game:service'RunService'.RenderStepped:connect(function()
  216.  
  217. accuracyFrame.Position = UDim2.new(0, Player:GetMouse().X-accuracyFrame.Size.X.Offset/2, 0, Player:GetMouse().Y-accuracyFrame.Size.Y.Offset/2)
  218.  
  219. end)
  220.  
  221. local accuracy1 = Instance.new("Frame", accuracyFrame)
  222.  
  223. accuracy1.BackgroundColor = BrickColor.new("White")
  224.  
  225. accuracy1.Size = UDim2.new(0, 8, 0, 2)
  226.  
  227. accuracy1.Position = UDim2.new(0, 0, .5, -1)
  228.  
  229. local accuracy2 = Instance.new("Frame", accuracyFrame)
  230.  
  231. accuracy2.BackgroundColor = BrickColor.new("White")
  232.  
  233. accuracy2.Size = UDim2.new(0, 8, 0, 2)
  234.  
  235. accuracy2.Position = UDim2.new(1, -8, .5, -1)
  236.  
  237. local accuracy3 = Instance.new("Frame", accuracyFrame)
  238.  
  239. accuracy3.BackgroundColor = BrickColor.new("White")
  240.  
  241. accuracy3.Size = UDim2.new(0, 2, 0, 8)
  242.  
  243. accuracy3.Position = UDim2.new(.5, -1, 0, 0)
  244.  
  245. local accuracy4 = Instance.new("Frame", accuracyFrame)
  246.  
  247. accuracy4.BackgroundColor = BrickColor.new("White")
  248.  
  249. accuracy4.Size = UDim2.new(0, 2, 0, 8)
  250.  
  251. accuracy4.Position = UDim2.new(.5, -1, 1, -8)
  252.  
  253. accuracyFrame.Visible = true
  254.  
  255.  
  256. mouse.Icon = "http://www.roblox.com/asset?id=75216962"
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264. New = function(Object, Parent, Name, Data)
  265. local Object = Instance.new(Object)
  266. for Index, Value in pairs(Data or {}) do
  267. Object[Index] = Value
  268. end
  269. Object.Parent = Parent
  270. Object.Name = Name
  271. return Object
  272. end
  273. K1911 = New("Model",Character,"K1911",{})
  274. Handle = New("Part",K1911,"Handle",{BrickColor = BrickColor.new("Dark stone grey"),Material = Enum.Material.SmoothPlastic,Size = Vector3.new(0.530000031, 1.11000001, 0.269999951),CFrame = CFrame.new(-34.6798782, 2.69211316, -16, 0.994522989, 0.104528531, 0, -0.104528464, 0.994521201, 0, 0, 0, 1.00000072),CanCollide = false,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,Color = Color3.new(0.388235, 0.372549, 0.384314),})
  275. Triggermesh = New("Part",K1911,"Triggermesh",{BrickColor = BrickColor.new("Dark stone grey"),Reflectance = 0.10000000149012,FormFactor = Enum.FormFactor.Symmetric,Size = Vector3.new(0.179999992, 0.25999999, 0.0599999726),CFrame = CFrame.new(-34.2399559, 3.03731799, -15.9999371, 0.390543848, 0.920583785, -0.00219476013, 0.920583367, -0.390543371, 0.000196098365, -0.000676624477, -0.00209704484, -0.999998927),CanCollide = false,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,Color = Color3.new(0.388235, 0.372549, 0.384314),})
  276. Mesh = New("SpecialMesh",Triggermesh,"Mesh",{Scale = Vector3.new(0.333333343, 0.466666669, 0.666666687),MeshId = "http://www.roblox.com/asset/?id=3270017",MeshType = Enum.MeshType.FileMesh,})
  277. mot = New("Motor",Triggermesh,"mot",{Part0 = Triggermesh,Part1 = Handle,C0 = CFrame.new(0, 0, 0, 0.390543371, 0.920584202, -0.000676623837, 0.920582354, -0.39054364, -0.00209704298, -0.00219475664, 0.00019609835, -0.999997973),C1 = CFrame.new(0.401428223, 0.389298439, 6.29425049e-05, 0.994522274, -0.104528472, 0, 0.104528494, 0.994521677, 0, 0, 0, 1.00000024),})
  278. bullethole = New("Part",K1911,"bullethole",{BrickColor = BrickColor.new("Dark stone grey"),Material = Enum.Material.SmoothPlastic,Shape = Enum.PartType.Cylinder,Size = Vector3.new(0.809999943, 0.189999968, 0.189999968),CFrame = CFrame.new(-33.333004, 3.3820014, -16, 1.00000179, -9.68575478e-08, 0, -1.11758709e-07, 0.999998868, 0, 0, 0, 1.00000119),CanCollide = false,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,Color = Color3.new(0.388235, 0.372549, 0.384314),})
  279. mot = New("Motor",bullethole,"mot",{Part0 = bullethole,Part1 = Handle,C0 = CFrame.new(0, 0, 0, 1.00000036, -2.98023224e-08, 0, -1.49011612e-08, 0.999999762, 0, 0, 0, 1.00000024),C1 = CFrame.new(1.26737976, 0.826895952, 0, 0.994522274, -0.104528472, 0, 0.104528494, 0.994521677, 0, 0, 0, 1.00000024),})
  280. Part = New("Part",K1911,"Part",{Material = Enum.Material.SmoothPlastic,Reflectance = 0.11999999731779,Size = Vector3.new(1.98999989, 0.370000035, 0.289999992),CFrame = CFrame.new(-33.9300079, 3.37500191, -16, 1.00000036, -1.49011612e-08, 0, -2.23517418e-08, 0.999999762, 0, 0, 0, 1.00000024),CanCollide = false,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,})
  281. mot = New("Motor",Part,"mot",{Part0 = Part,Part1 = Handle,C0 = CFrame.new(0, 0, 0, 1.00000036, -2.23517418e-08, 0, -1.49011612e-08, 0.999999762, 0, 0, 0, 1.00000024),C1 = CFrame.new(0.674381256, 0.757531166, 0, 0.994522274, -0.104528472, 0, 0.104528494, 0.994521677, 0, 0, 0, 1.00000024),})
  282. Part = New("Part",K1911,"Part",{BrickColor = BrickColor.new("Dark stone grey"),Material = Enum.Material.SmoothPlastic,Size = Vector3.new(1.05999994, 0.179999977, 0.249999985),CFrame = CFrame.new(-33.8850136, 3.13003469, -16, 1.00000322, -1.71363354e-07, 0, -1.86264515e-07, 0.999997973, 0, 0, 0, 1.00000215),CanCollide = false,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,Color = Color3.new(0.388235, 0.372549, 0.384314),})
  283. mot = New("Motor",Part,"mot",{Part0 = Part,Part1 = Handle,C0 = CFrame.new(0, 0, 0, 1.00000107, -6.70552254e-08, 0, -5.21540642e-08, 0.999999344, 0, 0, 0, 1.00000072),C1 = CFrame.new(0.744735718, 0.518609047, 0, 0.994522989, -0.104528464, 0, 0.104528531, 0.994521201, 0, 0, 0, 1.00000072),})
  284. Part = New("Part",K1911,"Part",{BrickColor = BrickColor.new("Dark stone grey"),Material = Enum.Material.SmoothPlastic,Shape = Enum.PartType.Cylinder,Size = Vector3.new(0.620000005, 0.229999989, 0.229999989),CFrame = CFrame.new(-33.2650108, 3.1581521, -16, 1.00000322, -1.71363354e-07, 0, -1.86264515e-07, 0.999997973, 0, 0, 0, 1.00000215),CanCollide = false,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,Color = Color3.new(0.388235, 0.372549, 0.384314),})
  285. mot = New("Motor",Part,"mot",{Part0 = Part,Part1 = Handle,C0 = CFrame.new(0, 0, 0, 1.00000107, -6.70552254e-08, 0, -5.21540642e-08, 0.999999344, 0, 0, 0, 1.00000072),C1 = CFrame.new(1.35840225, 0.611380339, 0, 0.994522989, -0.104528464, 0, 0.104528531, 0.994521201, 0, 0, 0, 1.00000072),})
  286. Part = New("Part",K1911,"Part",{BrickColor = BrickColor.new("Dark stone grey"),Material = Enum.Material.SmoothPlastic,Size = Vector3.new(0.530000031, 1.07000005, 0.189999953),CFrame = CFrame.new(-34.611969, 2.67222261, -16, 0.994525135, 0.104528643, 0, -0.104528435, 0.99451983, 0, 0, 0, 1.00000215),CanCollide = false,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,Color = Color3.new(0.388235, 0.372549, 0.384314),})
  287. mot = New("Motor",Part,"mot",{Part0 = Part,Part1 = Handle,C0 = CFrame.new(0, 0, 0, 0.994522989, -0.104528464, 0, 0.104528531, 0.994521201, 0, 0, 0, 1.00000072),C1 = CFrame.new(0.0696144104, -0.0126833916, 0, 0.994522989, -0.104528464, 0, 0.104528531, 0.994521201, 0, 0, 0, 1.00000072),})
  288. Clip = New("Part",K1911,"Clip",{BrickColor = BrickColor.new("Really black"),Material = Enum.Material.SmoothPlastic,Size = Vector3.new(0.420000017, 1.07000005, 0.189999953),CFrame = CFrame.new(-34.6671104, 2.66717649, -16, 0.994525135, 0.104528643, 0, -0.104528435, 0.99451983, 0, 0, 0, 1.00000215),CanCollide = false,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,Color = Color3.new(0.0666667, 0.0666667, 0.0666667),})
  289. mot = New("Motor",Clip,"mot",{Part0 = Clip,Part1 = Handle,C0 = CFrame.new(0, 0, 0, 0.994522989, -0.104528464, 0, 0.104528531, 0.994521201, 0, 0, 0, 1.00000072),C1 = CFrame.new(0.0153045654, -0.023465395, 0, 0.994522989, -0.104528464, 0, 0.104528531, 0.994521201, 0, 0, 0, 1.00000072),})
  290. bhole = New("Part",K1911,"bhole",{BrickColor = BrickColor.new("Really black"),Material = Enum.Material.SmoothPlastic,Shape = Enum.PartType.Cylinder,Size = Vector3.new(1.66999996, 0.169999972, 0.169999972),CFrame = CFrame.new(-33.7600136, 3.38231826, -16, 1.00000322, -1.71363354e-07, 0, -1.86264515e-07, 0.999997973, 0, 0, 0, 1.00000215),CanCollide = false,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,Color = Color3.new(0.0666667, 0.0666667, 0.0666667),})
  291. mot = New("Motor",bhole,"mot",{Part0 = bhole,Part1 = Handle,C0 = CFrame.new(0, 0, 0, 1.00000107, -6.70552254e-08, 0, -5.21540642e-08, 0.999999344, 0, 0, 0, 1.00000072),C1 = CFrame.new(0.84267807, 0.782576561, 0, 0.994522989, -0.104528464, 0, 0.104528531, 0.994521201, 0, 0, 0, 1.00000072),})
  292. Part = New("Part",K1911,"Part",{BrickColor = BrickColor.new("Burnt Sienna"),Material = Enum.Material.Wood,Size = Vector3.new(0.370000064, 0.920000076, 0.280000001),CFrame = CFrame.new(-34.6795921, 2.66959429, -16, 0.994525135, 0.104528643, 0, -0.104528435, 0.99451983, 0, 0, 0, 1.00000215),CanCollide = false,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,Color = Color3.new(0.415686, 0.223529, 0.0352941),})
  293. mot = New("Motor",Part,"mot",{Part0 = Part,Part1 = Handle,C0 = CFrame.new(0, 0, 0, 0.994522989, -0.104528464, 0, 0.104528531, 0.994521201, 0, 0, 0, 1.00000072),C1 = CFrame.new(0.00263977051, -0.0223655701, 0, 0.994522989, -0.104528464, 0, 0.104528531, 0.994521201, 0, 0, 0, 1.00000072),})
  294. Part = New("Part",K1911,"Part",{Material = Enum.Material.SmoothPlastic,Shape = Enum.PartType.Cylinder,Size = Vector3.new(0.289999962, 0.160000041, 0.160000041),CFrame = CFrame.new(-34.7095528, 2.37562132, -16, 1.09896426e-07, -1.71363354e-07, -1.00000322, -2.04281037e-14, 0.999997914, 1.86264515e-07, 1.00000215, 0, 1.09896298e-07),CanCollide = false,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,})
  295. mot = New("Motor",Part,"mot",{Part0 = Part,Part1 = Handle,C0 = CFrame.new(0, 0, 0, 1.09896185e-07, -7.10542736e-15, 1.00000072, -5.21540642e-08, 0.999999285, 0, -1.00000107, 6.70552254e-08, 1.09896142e-07),C1 = CFrame.new(0.00357055664, -0.317860126, 0, 0.994522989, -0.104528464, 0, 0.104528531, 0.994521201, 0, 0, 0, 1.00000072),})
  296. Part = New("Part",K1911,"Part",{Material = Enum.Material.SmoothPlastic,Shape = Enum.PartType.Cylinder,Size = Vector3.new(0.289999962, 0.160000026, 0.160000026),CFrame = CFrame.new(-34.6395531, 2.95001388, -16, 1.09896426e-07, -1.71363354e-07, -1.00000322, -2.04281037e-14, 0.999997795, 1.86264515e-07, 1.00000215, 0, 1.09896298e-07),CanCollide = false,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,})
  297. mot = New("Motor",Part,"mot",{Part0 = Part,Part1 = Handle,C0 = CFrame.new(0, 0, 0, 1.09896185e-07, -7.10542736e-15, 1.00000072, -5.21540642e-08, 0.999999166, 0, -1.00000107, 6.70552254e-08, 1.09896142e-07),C1 = CFrame.new(0.0131454468, 0.260703087, 0, 0.994522989, -0.104528464, 0, 0.104528531, 0.994521201, 0, 0, 0, 1.00000072),})
  298. Part = New("Part",K1911,"Part",{BrickColor = BrickColor.new("Really black"),Shape = Enum.PartType.Cylinder,Size = Vector3.new(0.189999953, 0.119999975, 0.119999975),CFrame = CFrame.new(-33.0400124, 3.15800071, -16, 1.00000322, -1.78813934e-07, 0, -1.86264515e-07, 0.999997735, 0, 0, 0, 1.00000215),CanCollide = false,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,Color = Color3.new(0.0666667, 0.0666667, 0.0666667),})
  299. mot = New("Motor",Part,"mot",{Part0 = Part,Part1 = Handle,C0 = CFrame.new(0, 0, 0, 1.00000107, -6.70552254e-08, 0, -5.96046448e-08, 0.999999106, 0, 0, 0, 1.00000072),C1 = CFrame.new(1.58218384, 0.634748459, 0, 0.994522989, -0.104528464, 0, 0.104528531, 0.994521201, 0, 0, 0, 1.00000072),})
  300. Part = New("Part",K1911,"Part",{Material = Enum.Material.Metal,Size = Vector3.new(0.110000029, 0.109999999, 0.200000003),CFrame = CFrame.new(-34.8181458, 3.55000734, -15.9967442, 1.00000322, -1.86264515e-07, 0, -1.86264515e-07, 0.999997735, 0, 0, 0, 1.00000215),CanCollide = false,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,})
  301. mot = New("Motor",Part,"mot",{Part0 = Part,C1 = CFrame.new(-0.0431270599, 0.729999065, -0.00174999237, 1, 0, 0, 0, 1, 0, 0, 0, 1),})
  302. mot = New("Motor",Part,"mot",{Part0 = Part,Part1 = Handle,C0 = CFrame.new(0, 0, 0, 1.00000107, -6.70552254e-08, 0, -6.70552254e-08, 0.999999106, 0, 0, 0, 1.00000072),C1 = CFrame.new(-0.227184296, 0.838742256, 0.00325584412, 0.994522989, -0.104528464, 0, 0.104528531, 0.994521201, 0, 0, 0, 1.00000072),})
  303. Part = New("Part",K1911,"Part",{Material = Enum.Material.Metal,Size = Vector3.new(0.110000029, 0.0500000007, 0.0500000082),CFrame = CFrame.new(-34.8181458, 3.63000631, -16.0717449, 1.00000322, -1.86264515e-07, 0, -1.86264515e-07, 0.999997735, 0, 0, 0, 1.00000215),CanCollide = false,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,})
  304. mot = New("Motor",Part,"mot",{Part0 = Part,C1 = CFrame.new(-0.0431270599, 0.729999065, -0.00174999237, 1, 0, 0, 0, 1, 0, 0, 0, 1),})
  305. mot = New("Motor",Part,"mot",{Part0 = Part,Part1 = Handle,C0 = CFrame.new(0, 0, 0, 1.00000107, -6.70552254e-08, 0, -6.70552254e-08, 0.999999106, 0, 0, 0, 1.00000072),C1 = CFrame.new(-0.235546112, 0.918303013, -0.0717449188, 0.994522989, -0.104528464, 0, 0.104528531, 0.994521201, 0, 0, 0, 1.00000072),})
  306. Part = New("Part",K1911,"Part",{Material = Enum.Material.Metal,Size = Vector3.new(0.110000029, 0.0500000007, 0.0500000007),CFrame = CFrame.new(-34.8181419, 3.62999988, -15.9217443, 1.00000322, -1.86264515e-07, 0, -1.86264515e-07, 0.999997735, 0, 0, 0, 1.00000215),CanCollide = false,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,})
  307. mot = New("Motor",Part,"mot",{Part0 = Part,C1 = CFrame.new(-0.0431270599, 0.729999065, -0.00174999237, 1, 0, 0, 0, 1, 0, 0, 0, 1),})
  308. mot = New("Motor",Part,"mot",{Part0 = Part,Part1 = Handle,C0 = CFrame.new(0, 0, 0, 1.00000107, -6.70552254e-08, 0, -6.70552254e-08, 0.999999106, 0, 0, 0, 1.00000072),C1 = CFrame.new(-0.235542297, 0.918297052, 0.0782556534, 0.994522989, -0.104528464, 0, 0.104528531, 0.994521201, 0, 0, 0, 1.00000072),})
  309. Part = New("Part",K1911,"Part",{BrickColor = BrickColor.new("Dark stone grey"),Material = Enum.Material.SmoothPlastic,Size = Vector3.new(0.10999997, 0.179999977, 0.0500000007),CFrame = CFrame.new(-34.220005, 3.02002287, -16, 0.981630385, -0.190809816, 0, 0.190808371, 0.981624961, 0, 0, 0, 1.00000215),CanCollide = false,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,Color = Color3.new(0.388235, 0.372549, 0.384314),})
  310. mot = New("Motor",Part,"mot",{Part0 = Part,Part1 = Handle,C0 = CFrame.new(0, 0, 0, 0.981628299, 0.190808743, 0, -0.19080928, 0.981626272, 0, 0, 0, 1.00000072),C1 = CFrame.new(0.42307663, 0.374183416, 0, 0.994522989, -0.104528464, 0, 0.104528531, 0.994521201, 0, 0, 0, 1.00000072),})
  311. Part = New("Part",K1911,"Part",{Material = Enum.Material.Metal,Size = Vector3.new(0.100000069, 0.139999986, 0.0800000057),CFrame = CFrame.new(-33.0113029, 3.55999947, -16, 1.00000322, -1.78813934e-07, 0, -2.01165676e-07, 0.999997735, 0, 0, 0, 1.00000215),CanCollide = false,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,})
  312. mot = New("Motor",Part,"mot",{Part0 = Part,Part1 = Handle,C0 = CFrame.new(0, 0, 0, 1.00000107, -8.19563866e-08, 0, -5.96046448e-08, 0.999999106, 0, 0, 0, 1.00000072),C1 = CFrame.new(1.56871414, 1.03754616, 0, 0.994522989, -0.104528464, 0, 0.104528531, 0.994521201, 0, 0, 0, 1.00000072),})
  313. Part = New("Part",K1911,"Part",{Material = Enum.Material.Metal,Shape = Enum.PartType.Cylinder,Size = Vector3.new(0.080000028, 0.119999945, 0.119999945),CFrame = CFrame.new(-34.9629974, 3.43419743, -16, 0, -1.86264515e-07, 1.00000334, 0, 0.999997735, -1.93715096e-07, -1.00000226, 0, 0),CanCollide = false,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,})
  314. mot = New("Motor",Part,"mot",{Part0 = Part,Part1 = Handle,C0 = CFrame.new(0, 0, 0, 0, 0, -1.00000083, -6.70552254e-08, 0.999999106, 0, 1.00000119, -7.4505806e-08, 0),C1 = CFrame.new(-0.359138489, 0.708425283, 0, 0.994522989, -0.104528464, 0, 0.104528531, 0.994521201, 0, 0, 0, 1.00000072),})
  315. Part = New("Part",K1911,"Part",{Material = Enum.Material.Metal,Size = Vector3.new(0.120000049, 0.160000026, 0.0800000727),CFrame = CFrame.new(-34.9034996, 3.41254854, -16, 0.777148902, 0.62932241, 0, -0.629318953, 0.777144134, 0, 0, 0, 1.00000238),CanCollide = false,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,})
  316. mot = New("Motor",Part,"mot",{Part0 = Part,Part1 = Handle,C0 = CFrame.new(0, 0, 0, 0.777147114, -0.629319727, 0, 0.629321098, 0.777145267, 0, 0, 0, 1.00000095),C1 = CFrame.new(-0.297702789, 0.693114519, 0, 0.994522989, -0.104528464, 0, 0.104528531, 0.994521201, 0, 0, 0, 1.00000072),})
  317. Part = New("Part",K1911,"Part",{Transparency = 1,Transparency = 1,Size = Vector3.new(0.459999889, 0.24000001, 0.179999948),CFrame = CFrame.new(-33.6749954, 3.41999912, -15.9449997, 1.00000358, -1.93715096e-07, 0, -2.01165676e-07, 0.999997735, 0, 0, 0, 1.00000238),CanCollide = false,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,})
  318. mot = New("Motor",Part,"mot",{Part0 = Part,Part1 = Handle,C0 = CFrame.new(0, 0, 0, 1.00000143, -8.19563866e-08, 0, -7.4505806e-08, 0.999999106, 0, 0, 0, 1.00000095),C1 = CFrame.new(0.923290253, 0.828937769, 0.0550003052, 0.994522989, -0.104528464, 0, 0.104528531, 0.994521201, 0, 0, 0, 1.00000072),})
  319.  
  320. local NewInstance = function(instance,parent,properties)
  321. local inst = Instance.new(instance,parent)
  322. if(properties)then
  323. for i,v in next, properties do
  324. pcall(function() inst[i] = v end)
  325. end
  326. end
  327. return inst;
  328. end
  329.  
  330.  
  331. local HW = NewInstance('Weld',Character,{Part0=RightArm,Part1=Handle,C0 = CFrame.new(0,-0.72,-0.14)*CFrame.Angles(math.rad(-95),math.rad(90),math.rad(0))})
  332.  
  333.  
  334.  
  335.  
  336. so = function(id,par,vol,pit)
  337. coroutine.resume(coroutine.create(function()
  338. local sou = Instance.new("Sound",par or workspace)
  339. sou.Volume=vol
  340. sou.Pitch=pit or 1
  341. sou.SoundId=id
  342. sou:play()
  343. game:GetService("Debris"):AddItem(sou,8)
  344. end))
  345. end
  346.  
  347.  
  348. function clerp(a,b,t)
  349. local qa = {QuaternionFromCFrame(a)}
  350. local qb = {QuaternionFromCFrame(b)}
  351. local ax, ay, az = a.x, a.y, a.z
  352. local bx, by, bz = b.x, b.y, b.z
  353. local _t = 1-t
  354. return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t))
  355. end
  356.  
  357. function QuaternionFromCFrame(cf)
  358. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  359. local trace = m00 + m11 + m22
  360. if trace > 0 then
  361. local s = math.sqrt(1 + trace)
  362. local recip = 0.5/s
  363. return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5
  364. else
  365. local i = 0
  366. if m11 > m00 then
  367. i = 1
  368. end
  369. if m22 > (i == 0 and m00 or m11) then
  370. i = 2
  371. end
  372. if i == 0 then
  373. local s = math.sqrt(m00-m11-m22+1)
  374. local recip = 0.5/s
  375. return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip
  376. elseif i == 1 then
  377. local s = math.sqrt(m11-m22-m00+1)
  378. local recip = 0.5/s
  379. return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip
  380. elseif i == 2 then
  381. local s = math.sqrt(m22-m00-m11+1)
  382. local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip
  383. end
  384. end
  385. end
  386.  
  387.  
  388.  
  389. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  390. local xs, ys, zs = x + x, y + y, z + z
  391. local wx, wy, wz = w*xs, w*ys, w*zs
  392. local xx = x*xs
  393. local xy = x*ys
  394. local xz = x*zs
  395. local yy = y*ys
  396. local yz = y*zs
  397. local zz = z*zs
  398. 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))
  399. end
  400. function QuaternionSlerp(a, b, t)
  401. local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4]
  402. local startInterp, finishInterp;
  403. if cosTheta >= 0.0001 then
  404. if (1 - cosTheta) > 0.0001 then
  405. local theta = math.acos(cosTheta)
  406. local invSinTheta = 1/math.sin(theta)
  407. startInterp = math.sin((1-t)*theta)*invSinTheta
  408. finishInterp = math.sin(t*theta)*invSinTheta
  409. else
  410. startInterp = 1-t
  411. finishInterp = t
  412. end
  413. else
  414. if (1+cosTheta) > 0.0001 then
  415. local theta = math.acos(-cosTheta)
  416. local invSinTheta = 1/math.sin(theta)
  417. startInterp = math.sin((t-1)*theta)*invSinTheta
  418. finishInterp = math.sin(t*theta)*invSinTheta
  419. else
  420. startInterp = t-1
  421. finishInterp = t
  422. end
  423. end
  424. 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
  425. end
  426. mouse=Player:GetMouse()
  427. --save shoulders
  428. RSH, LSH=nil, nil
  429. --welds
  430. RW, LW=Instance.new("Weld"), Instance.new("Weld")
  431. RW.Name="Right Shoulder" LW.Name="Left Shoulder"
  432. LH=Torso["Left Hip"]
  433. RH=Torso["Right Hip"]
  434. TorsoColor=Torso.BrickColor
  435. function NoOutline(Part)
  436. Part.TopSurface,Part.BottomSurface,Part.LeftSurface,Part.RightSurface,Part.FrontSurface,Part.BackSurface = 10,10,10,10,10,10
  437. end
  438. player=Player
  439. ch=Character
  440. RSH=ch.Torso["Right Shoulder"]
  441. LSH=ch.Torso["Left Shoulder"]
  442. --
  443. RSH.Parent=nil
  444. LSH.Parent=nil
  445. --
  446. RW.Name="Right Shoulder"
  447. RW.Part0=ch.Torso
  448. RW.C0=cf(1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.3, 0, -0.5)
  449. RW.C1=cf(0, 0.5, 0)
  450. RW.Part1=ch["Right Arm"]
  451. RW.Parent=ch.Torso
  452. --
  453. LW.Name="Left Shoulder"
  454. LW.Part0=ch.Torso
  455. LW.C0=cf(-1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.7, 0, 0.8)
  456. LW.C1=cf(0, 0.5, 0)
  457. LW.Part1=ch["Left Arm"]
  458. LW.Parent=ch.Torso
  459.  
  460. ArtificialHB = Instance.new("BindableEvent", script)
  461. ArtificialHB.Name = "Heartbeat"
  462.  
  463. script:WaitForChild("Heartbeat")
  464.  
  465. frame = 1 / 80
  466. tf = 0
  467. allowframeloss = false
  468. tossremainder = false
  469. lastframe = tick()
  470. script.Heartbeat:Fire()
  471. game:GetService("RunService").Heartbeat:connect(function(s, p)
  472. tf = tf + s
  473. if tf >= frame then
  474. if allowframeloss then
  475. script.Heartbeat:Fire()
  476. lastframe = tick()
  477. else
  478. for i = 1, math.floor(tf / frame) do
  479. script.Heartbeat:Fire()
  480. end
  481. lastframe = tick()
  482. end
  483. if tossremainder then
  484. tf = 0
  485. else
  486. tf = tf - frame * math.floor(tf / frame)
  487. end
  488. end
  489. end)
  490.  
  491. --[[]
  492. function swait(num)
  493. if num == 0 or num == nil then
  494. ArtificialHB.Event:wait()
  495. else
  496. for i = 0, num do
  497. ArtificialHB.Event:wait()
  498. end
  499. end
  500. end
  501.  
  502. ]]
  503.  
  504.  
  505. function swait(num)
  506. if num == 0 or num == nil then
  507. game:service("RunService").Stepped:wait()
  508. else
  509. for i = 0, num do
  510. game:service("RunService").Stepped:wait()
  511. end
  512. end
  513. end
  514.  
  515.  
  516. game:GetService("UserInputService").MouseIconEnabled = false
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531. function RemoveOutlines(part)
  532. part.TopSurface, part.BottomSurface, part.LeftSurface, part.RightSurface, part.FrontSurface, part.BackSurface = 10, 10, 10, 10, 10, 10
  533. end
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544. F1 = Instance.new("Folder", Character)
  545. F1.Name = "Effects Folder"
  546. F2 = Instance.new("Folder", F1)
  547. F2.Name = "Effects"
  548. Triangle = function(a, b, c)
  549. end
  550.  
  551. MagicBlock = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay, Type, parent)
  552. local prt = part(3, workspace, 0, 0, brickcolor, "Effect", vt())
  553. prt.Anchored = true
  554. prt.CFrame = cframe
  555. msh = mesh("BlockMesh", prt, "", "", vt(0, 0, 0), vt(x1, y1, z1))
  556. game:GetService("Debris"):AddItem(prt, 10)
  557. if Type == 1 or Type == nil then
  558. table.insert(Effects, {prt, "Block1", delay, x3, y3, z3, msh})
  559. else
  560. if Type == 2 then
  561. table.insert(Effects, {prt, "Block2", delay, x3, y3, z3, msh})
  562. else
  563. if Type == 3 then
  564. table.insert(Effects, {prt, "Block3", delay, x3, y3, z3, msh, prt.CFrame * euler(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50)), 0})
  565. end
  566. end
  567. end
  568. end
  569. MagicSkull = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay, goe)
  570. local prt = part(3, workspace, 0, 0, brickcolor, "Effect", vt())
  571. prt.Anchored = true
  572. prt.CFrame = cframe
  573. msh = mesh("SpecialMesh", prt, "FileMesh", "14028428", vt(0, 0, 0), vt(x1, y1, z1))
  574. game:GetService("Debris"):AddItem(prt, 10)
  575. table.insert(Effects, {prt, "Skull", delay, x3, y3, z3, msh, goe})
  576. end
  577. MagicCircle = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  578. local prt = part(3, workspace, 0, 0, brickcolor, "Effect", vt())
  579. prt.Anchored = true
  580. prt.CFrame = cframe
  581. local msh = mesh("SpecialMesh", prt, "Sphere", "nil", vt(0, 0, 0), vt(x1, y1, z1))
  582. game:GetService("Debris"):AddItem(prt, 10)
  583. table.insert(Effects, {prt, "Cylinder", delay, x3, y3, z3, msh})
  584. end
  585. MagicRing = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  586. local prt = part(3, workspace, 0, 0, brickcolor, "Effect", vt(0.5, 0.5, 0.5))
  587. prt.Anchored = true
  588. prt.CFrame = cframe * cf(x2, y2, z2)
  589. local msh = mesh("SpecialMesh", prt, "FileMesh", "3270017", vt(0, 0, 0), vt(x1, y1, z1))
  590. game:GetService("Debris"):AddItem(prt, 10)
  591. table.insert(Effects, {prt, "Cylinder", delay, x3, y3, z3, msh})
  592. end
  593. MagicCircle2 = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay, push)
  594. local prt = part(3, workspace, 0, 0, brickcolor, "Effect", vt())
  595. prt.Anchored = true
  596. prt.CFrame = cframe
  597. local msh = mesh("SpecialMesh", prt, "Sphere", "nil", vt(0, 0, 0), vt(x1, y1, z1))
  598. game:GetService("Debris"):AddItem(prt, 10)
  599. table.insert(Effects, {prt, "Blood", delay, x3, y3, z3, msh, push})
  600. end
  601. MagicCylinder = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  602. local prt = part(3, workspace, 0, 0, brickcolor, "Effect", vt())
  603. prt.Anchored = true
  604. prt.CFrame = cframe
  605. local msh = mesh("CylinderMesh", prt, "", "", vt(0, 0, 0), vt(x1, y1, z1))
  606. game:GetService("Debris"):AddItem(prt, 10)
  607. table.insert(Effects, {prt, "Cylinder", delay, x3, y3, z3, msh})
  608. end
  609. MagicCylinder2 = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay, goe)
  610. local prt = part(3, workspace, 0, 0, brickcolor, "Effect", vt())
  611. prt.Anchored = true
  612. prt.CFrame = cframe
  613. local msh = mesh("CylinderMesh", prt, "", "", vt(0, 0, 0), vt(x1, y1, z1))
  614. game:GetService("Debris"):AddItem(prt, 10)
  615. table.insert(Effects, {prt, "Cylinder2", delay, x3, y3, z3, msh, goe})
  616. end
  617. MagicHead = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  618. local prt = part(3, workspace, 0, 0, brickcolor, "Effect", vt())
  619. prt.Anchored = true
  620. prt.CFrame = cframe
  621. local msh = mesh("SpecialMesh", prt, "Head", "nil", vt(0, 0, 0), vt(x1, y1, z1))
  622. game:GetService("Debris"):AddItem(prt, 10)
  623. table.insert(Effects, {prt, "Cylinder", delay, x3, y3, z3, msh})
  624. end
  625. ClangEffect = function(brickcolor, cframe, duration, decrease, size, power)
  626. local prt = part(3, workspace, 0, 1, brickcolor, "Effect", vt())
  627. prt.Anchored = true
  628. prt.CFrame = cframe
  629. local msh = mesh("BlockMesh", prt, "", "", vt(0, 0, 0), vt(5, 5, 5))
  630. game:GetService("Debris"):AddItem(prt, 10)
  631. table.insert(Effects, {prt, "CylinderClang", duration, decrease, size, power, prt.CFrame, nil})
  632. end
  633. MagicWave = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  634. local prt = part(3, workspace, 0, 0, brickcolor, "Effect", vt())
  635. prt.Anchored = true
  636. prt.CFrame = cframe
  637. local msh = mesh("SpecialMesh", prt, "FileMesh", "20329976", vt(0, 0, 0), vt(x1, y1, z1))
  638. game:GetService("Debris"):AddItem(prt, 10)
  639. table.insert(Effects, {prt, "Cylinder", delay, x3, y3, z3, msh})
  640. end
  641. MagicFire = function(brickcolor, cframe, x1, y1, z1, delay)
  642. local prt = part(3, workspace, 0, 0, brickcolor, "Effect", vt())
  643. prt.Anchored = true
  644. prt.CFrame = cframe
  645. msh = mesh("BlockMesh", prt, "", "", vt(0, 0, 0), vt(x1, y1, z1))
  646. game:GetService("Debris"):AddItem(prt, 10)
  647. table.insert(Effects, {prt, "Fire", delay, 1, 1, 1, msh})
  648. end
  649. MagicFireWave = function(brickcolor, cframe, x1, y1, z1)
  650. local prt = part(3, workspace, 0, 1, brickcolor, "Effect", vt())
  651. prt.Anchored = true
  652. prt.CFrame = cframe
  653. msh = mesh("BlockMesh", prt, "", "", vt(0, 0, 0), vt(x1, y1, z1))
  654. d = Instance.new("Decal")
  655. d.Parent = prt
  656. d.Texture = "http://www.roblox.com/asset/?id=26356434"
  657. d.Face = "Top"
  658. d = Instance.new("Decal")
  659. d.Parent = prt
  660. d.Texture = "http://www.roblox.com/asset/?id=26356434"
  661. d.Face = "Bottom"
  662. game:GetService("Debris"):AddItem(prt, 10)
  663. table.insert(Effects, {prt, "FireWave", 1, 30, math.random(400, 600) / 100, msh})
  664. end
  665. ElecEffect = function(cff, x, y, z)
  666. local prt = part(3, workspace, 0, 0, BrickColor.new("White"), "Part", vt(1, 1, 1))
  667. prt.Anchored = true
  668. prt.CFrame = cff * cf(math.random(-x, x), math.random(-y, y), math.random(-z, z))
  669. prt.CFrame = cf(prt.Position)
  670. game:GetService("Debris"):AddItem(prt, 10)
  671. xval = math.random() / 3
  672. yval = math.random() / 3
  673. zval = math.random() / 3
  674. msh = mesh("BlockMesh", prt, "", "", vt(0, 0, 0), vt(xval, yval, zval))
  675. Effects[#Effects + 1] = {prt, "Elec", 0.2, x, y, z, xval, yval, zval, msh}
  676. end
  677.  
  678. function FindNearestTorso(Position, Distance, SinglePlayer)
  679. if SinglePlayer then
  680. return (SinglePlayer.Torso.CFrame.p - Position).magnitude < Distance
  681. end
  682. local List = {}
  683. for i, v in pairs(workspace:GetChildren()) do
  684. if v:IsA("Model") then
  685. if v:findFirstChild("Torso") then
  686. if v ~= Character then
  687. if (v.Torso.Position - Position).magnitude <= Distance then
  688. table.insert(List, v)
  689. end
  690. end
  691. end
  692. end
  693. end
  694. return List
  695. end
  696.  
  697.  
  698. function CreatePart(Parent, Material, Reflectance, Transparency, BColor, Name, Size)
  699. local Part = Create("Part"){
  700. Parent = Parent,
  701. Reflectance = Reflectance,
  702. Transparency = Transparency,
  703. CanCollide = false,
  704. Locked = true,
  705. BrickColor = BrickColor.new(tostring(BColor)),
  706. Name = Name,
  707. Size = Size,
  708. Material = Material,
  709. }
  710. RemoveOutlines(Part)
  711. return Part
  712. end
  713.  
  714. function CreateMesh(Mesh, Part, MeshType, MeshId, OffSet, Scale)
  715. local Msh = Create(Mesh){
  716. Parent = Part,
  717. Offset = OffSet,
  718. Scale = Scale,
  719. }
  720. if Mesh == "SpecialMesh" then
  721. Msh.MeshType = MeshType
  722. Msh.MeshId = MeshId
  723. end
  724. return Msh
  725. end
  726.  
  727.  
  728.  
  729. function BlockEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay, Type)
  730. local prt = CreatePart(workspace, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
  731. prt.Anchored = true
  732. prt.CFrame = cframe
  733. local msh = CreateMesh("BlockMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  734. game:GetService("Debris"):AddItem(prt, 10)
  735. if Type == 1 or Type == nil then
  736. table.insert(Effects, {
  737. prt,
  738. "Block1",
  739. delay,
  740. x3,
  741. y3,
  742. z3,
  743. msh
  744. })
  745. elseif Type == 2 then
  746. table.insert(Effects, {
  747. prt,
  748. "Block2",
  749. delay,
  750. x3,
  751. y3,
  752. z3,
  753. msh
  754. })
  755. end
  756. end
  757.  
  758. function SphereEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  759. local prt = CreatePart(workspace, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
  760. prt.Anchored = true
  761. prt.CFrame = cframe
  762. prt.Name = "prt"
  763. local msh = CreateMesh("SpecialMesh", prt, "Sphere", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  764. game:GetService("Debris"):AddItem(prt, 10)
  765. table.insert(Effects, {
  766. prt,
  767. "Cylinder",
  768. delay,
  769. x3,
  770. y3,
  771. z3,
  772. msh
  773. })
  774. end
  775.  
  776. function RingEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  777. local prt=CreatePart(workspace,"Neon",0,0,brickcolor,"Effect",vt(.5,.5,.5))--part(3,workspace,"SmoothPlastic",0,0,brickcolor,"Effect",vt(0.5,0.5,0.5))
  778. prt.Anchored=true
  779. prt.CFrame=cframe
  780. msh=CreateMesh("SpecialMesh",prt,"FileMesh","http://www.roblox.com/asset/?id=3270017",vt(0,0,0),vt(x1,y1,z1))
  781. game:GetService("Debris"):AddItem(prt,2)
  782. coroutine.resume(coroutine.create(function(Part,Mesh,num)
  783. for i=0,1,delay do
  784. swait()
  785. Part.Transparency=i
  786. Mesh.Scale=Mesh.Scale+vt(x3,y3,z3)
  787. end
  788. Part.Parent=nil
  789. end),prt,msh,(math.random(0,1)+math.random())/5)
  790. end
  791.  
  792. function CylinderEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  793. local prt = CreatePart(workspace, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new())
  794. prt.Anchored = true
  795. prt.CFrame = cframe
  796. local msh = CreateMesh("CylinderMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  797. game:GetService("Debris"):AddItem(prt, 10)
  798. table.insert(Effects, {
  799. prt,
  800. "Cylinder",
  801. delay,
  802. x3,
  803. y3,
  804. z3,
  805. msh
  806. })
  807. end
  808.  
  809. function WaveEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  810. local prt = CreatePart(workspace, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
  811. prt.Anchored = true
  812. prt.CFrame = cframe
  813. local msh = CreateMesh("SpecialMesh", prt, "FileMesh", "rbxassetid://20329976", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  814. game:GetService("Debris"):AddItem(prt, 10)
  815. table.insert(Effects, {
  816. prt,
  817. "Cylinder",
  818. delay,
  819. x3,
  820. y3,
  821. z3,
  822. msh
  823. })
  824. end
  825.  
  826. function SpecialEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  827. local prt = CreatePart(workspace, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
  828. prt.Anchored = true
  829. prt.CFrame = cframe
  830. local msh = CreateMesh("SpecialMesh", prt, "FileMesh", "rbxassetid://24388358", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  831. game:GetService("Debris"):AddItem(prt, 10)
  832. table.insert(Effects, {
  833. prt,
  834. "Cylinder",
  835. delay,
  836. x3,
  837. y3,
  838. z3,
  839. msh
  840. })
  841. end
  842.  
  843.  
  844. function MoonEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  845. local prt = CreatePart(workspace, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
  846. prt.Anchored = true
  847. prt.CFrame = cframe
  848. local msh = CreateMesh("SpecialMesh", prt, "FileMesh", "rbxassetid://259403370", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  849. game:GetService("Debris"):AddItem(prt, 10)
  850. table.insert(Effects, {
  851. prt,
  852. "Cylinder",
  853. delay,
  854. x3,
  855. y3,
  856. z3,
  857. msh
  858. })
  859. end
  860.  
  861. function HeadEffect(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
  862. local prt = CreatePart(workspace, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
  863. prt.Anchored = true
  864. prt.CFrame = cframe
  865. local msh = CreateMesh("SpecialMesh", prt, "Head", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  866. game:GetService("Debris"):AddItem(prt, 10)
  867. table.insert(Effects, {
  868. prt,
  869. "Cylinder",
  870. delay,
  871. x3,
  872. y3,
  873. z3,
  874. msh
  875. })
  876. end
  877.  
  878. function BreakEffect(brickcolor, cframe, x1, y1, z1)
  879. local prt = CreatePart(workspace, "Neon", 0, 0, brickcolor, "Effect", Vector3.new(0.5, 0.5, 0.5))
  880. prt.Anchored = true
  881. prt.CFrame = cframe * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50))
  882. local msh = CreateMesh("SpecialMesh", prt, "Sphere", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
  883. local num = math.random(10, 50) / 1000
  884. game:GetService("Debris"):AddItem(prt, 10)
  885. table.insert(Effects, {
  886. prt,
  887. "Shatter",
  888. num,
  889. prt.CFrame,
  890. math.random() - math.random(),
  891. 0,
  892. math.random(50, 100) / 100
  893. })
  894. end
  895.  
  896. function FindNearestHead(Position, Distance, SinglePlayer)
  897. if SinglePlayer then
  898. return Distance > (SinglePlayer.Torso.CFrame.p - Position).magnitude
  899. end
  900. local List = {}
  901. for i, v in pairs(workspace:GetChildren()) do
  902. if v:IsA("Model") and v:findFirstChild("Head") and v ~= Character and Distance >= (v.Head.Position - Position).magnitude then
  903. table.insert(List, v)
  904. end
  905. end
  906. return List
  907. end
  908.  
  909.  
  910.  
  911. function Bullets(thinggy,place,size,color,velocity,damage,bounce,collide,rotation)
  912. swait()
  913. local Bullet = Instance.new("Part",Workspace)
  914. Bullet.Locked = true
  915. Bullet.Name = "Bullet"
  916. Bullet.Anchored = bounce
  917. Bullet.CanCollide = collide
  918. Bullet.Transparency = 0.24
  919. Bullet.BrickColor = BrickColor.new(color)
  920. Bullet.Size = Vector3.new(0.2,0.2,5)
  921. Bullet.Material = "Neon"
  922. Bullet.Orientation = vt(0,0,0)
  923. local Bulletforce = Instance.new("BodyForce")
  924. Bulletforce.force = Vector3.new(0,Bullet:GetMass()*166.2,0)
  925. Bulletforce.Parent = Bullet
  926. Bullet.CFrame = thinggy.CFrame*CFrame.new(0.75,0.74,0)
  927. local bv = Instance.new("BodyVelocity",Bullet)
  928. bv.maxForce = Vector3.new(math.huge,math.huge,math.huge)
  929. Bullet.CFrame = CFrame.new(Bullet.Position,mouse.Hit.p)
  930. bv.velocity = Bullet.CFrame.lookVector*velocity
  931. deb:AddItem(bv,0.4)
  932. deb:AddItem(Bullet,30)
  933.  
  934. Bullet.Touched:connect(function(hit)
  935.  
  936. if (hit.Parent.Parent ~= Character and hit.Parent ~= Character and hit.Name ~= "prt" and hit.Name ~= "Effect" and hit.Name ~= "Bullet" and Bullet.Anchored == false and hit.Name ~= "block" and hit.Name ~= "Shell") then
  937. local hitsound = Instance.new("Sound", Bullet)
  938. hitsound.Volume = 3
  939. hitsound.PlayOnRemove = true
  940. hitsound.SoundId = "http://roblox.com/asset/?id=578289949"
  941. hitsound.Pitch = 1
  942. hitsound:Destroy()
  943. deb:AddItem(hitsound, 4)
  944. Bullet.Anchored = true
  945. Bullet.Transparency = 1
  946. deb:AddItem(Bullet, 4)
  947. if hit.Parent:FindFirstChildOfClass("Humanoid") ~= nil then
  948. local bullethitsound = Instance.new("Sound", Bullet)
  949. bullethitsound.Volume = 4
  950. bullethitsound.PlayOnRemove = true
  951. bullethitsound.SoundId = "http://roblox.com/asset/?id=1452522753"
  952. bullethitsound.Pitch = 1
  953. bullethitsound:Destroy()
  954. deb:AddItem(bullethitsound, 4)
  955. hit.Parent:FindFirstChildOfClass("Humanoid"):TakeDamage(math.random(23,42))
  956. blood(12,Bullet.CFrame)
  957. end
  958. if hit.Parent:FindFirstChildOfClass("Humanoid") == nil then
  959. for i = 1,math.random(2,7) do
  960. local block = Instance.new("Part",Workspace)
  961. block.BrickColor = hit.BrickColor
  962. block.CFrame = Bullet.CFrame*CFrame.new(math.random(-4,6),math.random(1,3),math.random(-7,8))
  963. block.Size = vt(0.3,0.4,0.3)
  964. block.Name = "block"
  965. block.Material = hit.Material
  966. block.Velocity = vt(math.random(-22,33),math.random(-20,40),math.random(-10,20))
  967. deb:AddItem(block,8)
  968. end
  969. end
  970. coroutine.resume(coroutine.create(function()
  971. BlockEffect(BrickColor.new("New Yeller"), CFrame.new(Bullet.Position), 2, 2, 2, 1.5, 1.5, 1.5, 0.06)
  972.  
  973. end))
  974. end
  975. end)
  976. coroutine.resume(coroutine.create(function()
  977. wait(0.5)
  978. while true do
  979. swait()
  980. Bullet.Velocity = Bullet.Velocity - Vector3.new(0, 14.81*.2, 0)
  981. end
  982. end))
  983.  
  984. end
  985.  
  986.  
  987.  
  988. function blood(amount,pp)
  989.  
  990. for i = 1,amount do
  991. local bloodpart = Instance.new("Part",Workspace)
  992. bloodpart.Color = Color3.fromRGB(64,0,0)
  993. bloodpart.Size = vt(0.2,0.08,0.2)
  994. bloodpart.Archivable = true
  995. bloodpart.CFrame = pp
  996. bloodpart:BreakJoints()
  997. bloodpart.Velocity = (pp * CFrame.Angles(math.rad(math.random(20,30)*8), -math.rad(-40), math.rad(-20))).lookVector * 23
  998. deb:AddItem(bloodpart,8)
  999. end
  1000. end
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007. local ammo = 8
  1008. function reload()
  1009.  
  1010. attack = true
  1011. RW.C1 = clerp(RW.C1, CFrame.new(0, 0.5, 0) *angles(0,0,0),1)
  1012. LW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0) * angles(0,0,0),1)
  1013. Torso.Neck.C1 = clerp(Torso.Neck.C1,necko2 *angles(0,0,0),1)
  1014. for i = 0,1.6,0.1 do
  1015. swait()
  1016. Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(9),math.rad(0),math.rad(0)),.1)
  1017. RW.C0 = clerp(RW.C0, CFrame.new(0.7, 0.5, -0.3) * angles(math.rad(90), math.rad(0), math.rad(-23)),.2)
  1018. LW.C0 = clerp(LW.C0, CFrame.new(-.75, 0.5, -.9) * angles(math.rad(70), math.rad(-12), math.rad(47)),.2)
  1019. HW.C0 = clerp(HW.C0, CFrame.new(0,-1,-0.14)*CFrame.Angles(math.rad(-90),math.rad(90),math.rad(0)),0.15)
  1020. end
  1021. local Clip2 = Instance.new("Part")
  1022. Clip2.Parent = Workspace
  1023. Clip2.Size = Vector3.new(.2,.7,.2)
  1024. Clip2.Archivable = true
  1025. Clip2.Transparency = 0
  1026. Clip2.CanCollide = true
  1027. Clip2.Anchored = true
  1028. Clip2.BrickColor = BrickColor.New("Black")
  1029. Clip2.Material = "Metal"
  1030. Clip2.CFrame = LeftArm.CFrame
  1031. so("rbxassetid://1042833810",Handle,1,1)
  1032. Clip.Transparency = 1
  1033. Clip2:BreakJoints()
  1034. Clip2.Anchored = false
  1035. Clip2.Velocity = (LeftArm.CFrame * CFrame.Angles(math.rad(math.random(20,30)*8), -math.rad(-40), math.rad(-20))).lookVector * 42
  1036. game:service'Debris':AddItem(Clip2,10)
  1037.  
  1038. for i = 0,1.6,0.1 do
  1039. swait()
  1040. Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(9),math.rad(0),math.rad(23)),.15)
  1041. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(108), math.rad(0), math.rad(63)),.1)
  1042. LW.C0 = clerp(LW.C0, CFrame.new(-1.25, 0.5, 0) * angles(math.rad(87), math.rad(32), math.rad(-47-6*i)),.34)
  1043. HW.C0 = clerp(HW.C0, CFrame.new(0,-1,-0.34)*CFrame.Angles(math.rad(-70),math.rad(90),math.rad(0)),0.15)
  1044. end
  1045.  
  1046.  
  1047. for i = 0,1.8,0.1 do
  1048. swait()
  1049. Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(18),math.rad(0),math.rad(27)),.15)
  1050. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(100), math.rad(0), math.rad(63)),.2)
  1051. LW.C0 = clerp(LW.C0, CFrame.new(-1.25, 0.5, 0) * angles(math.rad(-17), math.rad(0), math.rad(4)),.2)
  1052. HW.C0 = clerp(HW.C0, CFrame.new(0,-1,-0.34)*CFrame.Angles(math.rad(-70),math.rad(90),math.rad(0)),0.15)
  1053. end
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060. local Clip3 = Instance.new("Part")
  1061. Clip3.Parent = Workspace
  1062. Clip3.Size = Vector3.new(.2,.7,.2)
  1063. Clip3.Archivable = true
  1064. Clip3.Transparency = 0
  1065. Clip3.CanCollide = false
  1066. Clip3.BrickColor = BrickColor.new("Black")
  1067. Clip3.Material = "Metal"
  1068. local Clip3weld = Instance.new("Weld")
  1069. Clip3weld.Parent = Clip3
  1070. Clip3weld.Part0 = LeftArm
  1071. Clip3weld.Part1 = Clip3
  1072. Clip3weld.C1 = CFrame.new(-0.12, .65, -0.7)*CFrame.Angles(math.rad(-80),math.rad(0),math.rad(0))
  1073. Clip3weld.Part0 = LeftArm
  1074.  
  1075.  
  1076. so("rbxassetid://1042833484",Handle,1,1)
  1077. for i = 0,1.7,0.1 do
  1078. swait()
  1079. Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(9),math.rad(0),math.rad(0)),.1)
  1080. RW.C0 = clerp(RW.C0, CFrame.new(0.7, 0.5, -0.3) * angles(math.rad(90), math.rad(0), math.rad(-23)),.2)
  1081. LW.C0 = clerp(LW.C0, CFrame.new(-.87, 0.5, -.9) * angles(math.rad(60), math.rad(-12), math.rad(62)),.25)
  1082. HW.C0 = clerp(HW.C0, CFrame.new(0,-1,-0.14)*CFrame.Angles(math.rad(-90),math.rad(90),math.rad(0)),0.15)
  1083. end
  1084.  
  1085. Clip3:Destroy()
  1086. Clip.Transparency = 0
  1087. so("rbxassetid://170160994",Handle,1,1)
  1088.  
  1089.  
  1090.  
  1091.  
  1092. for i = 0,1.6,0.1 do
  1093. swait()
  1094. Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(14),math.rad(0),math.rad(-14)),.1)
  1095. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(50), math.rad(0), math.rad(-33)),.2)
  1096. LW.C0 = clerp(LW.C0, CFrame.new(-.75, 0.7, -.8) * angles(math.rad(60), math.rad(-12), math.rad(57)),.13)
  1097. HW.C0 = clerp(HW.C0, CFrame.new(0,-1,-0.14)*CFrame.Angles(math.rad(-100),math.rad(90),math.rad(0)),0.15)
  1098. end
  1099.  
  1100.  
  1101.  
  1102. so("rbxassetid://170160964",Handle ,1,1)
  1103.  
  1104.  
  1105. for i = 0,1.6,0.1 do
  1106. swait()
  1107. Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(14),math.rad(0),math.rad(-8)),.1)
  1108. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(50), math.rad(0), math.rad(-33)),.2)
  1109. LW.C0 = clerp(LW.C0, CFrame.new(-.75, 0.7, -1) * angles(math.rad(60), math.rad(-12), math.rad(37)),.2)
  1110. HW.C0 = clerp(HW.C0, CFrame.new(0,-1,-0.14)*CFrame.Angles(math.rad(-100),math.rad(90),math.rad(0)),0.15)
  1111. end
  1112. ammo = 8
  1113. attack = false
  1114. end
  1115.  
  1116. local recoil = 0
  1117. local maxrecoil = 0
  1118.  
  1119.  
  1120. function shoot()
  1121. recoil = recoil + .6
  1122. ammo = ammo - 1
  1123. local Shell = Instance.new("Part")
  1124. Shell.Parent = Workspace
  1125. Shell.Size = Vector3.new(.1,.3,.1)
  1126. Shell.Archivable = true
  1127. Shell.Transparency = 0
  1128. Shell.Name = "Shell"
  1129. Shell.CanCollide = true
  1130. Shell.BrickColor = BrickColor.new("New Yeller")
  1131. Shell.Material = "Neon"
  1132. Shell.CFrame = bhole.CFrame*CFrame.new(-0.2,0.5,0)
  1133. Shell.Velocity = (bhole.CFrame * CFrame.Angles(math.rad(math.random(20,30)*8), -math.rad(-40), math.rad(-20))).lookVector * 42
  1134.  
  1135.  
  1136. local SLight = Instance.new('PointLight', bullethole)
  1137. SLight.Range = 12
  1138. SLight.Color = Color3.new(1,.6,.1)
  1139. SLight.Brightness = 3
  1140. game:service'Debris':AddItem(SLight, .05)
  1141.  
  1142.  
  1143.  
  1144. game:service'Debris':AddItem(Shell,7)
  1145.  
  1146. so("rbxassetid://966405773",bullethole,1,1)
  1147. Bullets(bullethole,0,0,"New Yeller",300,25.5,false,false)
  1148.  
  1149.  
  1150. accuracy1.Position = UDim2.new(0, -recoil*10, .5, -1)
  1151.  
  1152. accuracy2.Position = UDim2.new(1, -8 + recoil*10, .5, -1)
  1153.  
  1154. accuracy3.Position = UDim2.new(.5, -1, 0, -recoil*10)
  1155.  
  1156. accuracy4.Position = UDim2.new(.5, -1, 1, -8 + recoil*10)
  1157.  
  1158. Humanoid.CameraOffset = Humanoid.CameraOffset:lerp(Vector3.new(math.rad(math.random(-26.35*1.8,26.35*1.8)*recoil),math.rad(math.random(-26.35*1.8,26.35*1.8)*recoil),0.35*1.8*recoil),0.14)
  1159.  
  1160.  
  1161. RW.C0 = clerp(RW.C0, CFrame.new(0, 0.67, -0.25) * angles(math.rad(114), math.rad(0), math.rad(0)),.2)
  1162. LW.C0 = clerp(LW.C0, CFrame.new(-.35, 0.67, -0.66) * angles(math.rad(104), math.rad(0), math.rad(37)),.4)
  1163. HW.C0 = clerp(HW.C0, CFrame.new(0,-0.92,-0.24)*CFrame.Angles(math.rad(-25),math.rad(90),math.rad(0)),0.6)
  1164. Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(-12),math.rad(0),math.rad(0)),.4)
  1165. attack = false
  1166.  
  1167. end
  1168.  
  1169.  
  1170. mouse.KeyDown:connect(function(key)
  1171.  
  1172. if key == 'r' and attack == false then
  1173. reload()
  1174. end
  1175. end)
  1176.  
  1177.  
  1178. mouse.Button1Down:connect(function()
  1179. if attack == false and ammo > 0 then
  1180. if Swing == 2 then
  1181. Humanoid.WalkSpeed = 16
  1182. end
  1183. shoot()
  1184. end
  1185. end)
  1186.  
  1187.  
  1188.  
  1189. mouse.Button2Down:connect(function()
  1190. aim = true
  1191. Character.Humanoid.WalkSpeed = 16
  1192. accuracyFrame.Visible = false
  1193. end)
  1194.  
  1195.  
  1196. mouse.Button2Up:connect(function()
  1197. aim = false
  1198. accuracyFrame.Visible = true
  1199. end)
  1200.  
  1201.  
  1202.  
  1203.  
  1204.  
  1205.  
  1206. mouse.KeyDown:connect(function(key)
  1207. if string.byte(key) == 48 then
  1208. Swing = 2
  1209. aim = false
  1210. Humanoid.WalkSpeed = 32
  1211. end
  1212.  
  1213. end)
  1214.  
  1215. mouse.KeyUp:connect(function(key)
  1216. if string.byte(key) == 48 then
  1217. Swing = 1
  1218. Humanoid.WalkSpeed = 16
  1219.  
  1220. end
  1221. end)
  1222. local look = 0
  1223.  
  1224.  
  1225.  
  1226. while true do
  1227. swait()
  1228. sine = sine + change
  1229. local torvel=(RootPart.Velocity*Vector3.new(1,0,1)).magnitude
  1230. local velderp=RootPart.Velocity.y
  1231. RightArm.LocalTransparencyModifier = 0
  1232. LeftArm.LocalTransparencyModifier = 0
  1233. for _,v in pairs(K1911:GetChildren()) do
  1234. v.LocalTransparencyModifier = 0
  1235. end
  1236.  
  1237.  
  1238.  
  1239. if recoil > 0 then
  1240. recoil = recoil - .025
  1241. accuracy1.Position = UDim2.new(0, -recoil*10, .5, -1)
  1242.  
  1243. accuracy2.Position = UDim2.new(1, -8 + recoil*10, .5, -1)
  1244.  
  1245. accuracy3.Position = UDim2.new(.5, -1, 0, -recoil*10)
  1246.  
  1247. accuracy4.Position = UDim2.new(.5, -1, 1, -8 + recoil*10)
  1248.  
  1249. end
  1250.  
  1251.  
  1252. if attack == false then
  1253.  
  1254. HW.C0 = clerp(HW.C0, CFrame.new(0,-0.72,-0.14)*CFrame.Angles(math.rad(-95),math.rad(90),math.rad(0)),0.15)
  1255. RW.C1 = clerp(RW.C1, CFrame.new(0, 0.5, 0) * angles(-math.asin((mouse.Hit.p-mouse.Origin.p).unit.y),0,0),.25)
  1256. LW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0) * angles(-math.asin((mouse.Hit.p-mouse.Origin.p).unit.y),0,0),.25)
  1257. Torso.Neck.C1 = clerp(Torso.Neck.C1,necko2 *angles(math.asin((mouse.Hit.p-mouse.Origin.p).unit.y),0,0),.25)
  1258. Humanoid.CameraOffset = Humanoid.CameraOffset:lerp(Vector3.new(0,0,0),0.08)
  1259. if aim == false and torvel <1 then
  1260. cam.FieldOfView = lerp(cam.FieldOfView, 90, 0.076)
  1261. RW.C0 = clerp(RW.C0, CFrame.new(0.95, 0.3, -0.2) * angles(math.rad(90), math.rad(0), math.rad(0)+RootPart.RotVelocity.Y / 16),.2)
  1262. LW.C0 = clerp(LW.C0, CFrame.new(-.15, 0.3, -.65) * angles(math.rad(80), math.rad(0), math.rad(53)- RootPart.RotVelocity.Y / 32),.2)
  1263. Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(0),math.rad(0),math.rad(0)),.25)
  1264. end
  1265. if aim == false and torvel>1 and torvel<28 then
  1266. cam.FieldOfView = lerp(cam.FieldOfView, 100, 0.076)
  1267. Humanoid.CameraOffset = Humanoid.CameraOffset:lerp(Vector3.new(0+0.57*math.cos(sine/8),0+0.34*math.sin(sine/4),0),0.15)
  1268. RW.C0 = clerp(RW.C0, CFrame.new(0.95, 0.3, -0.2) * angles(math.rad(90), math.rad(0), math.rad(0)+RootPart.RotVelocity.Y / 16),.2)
  1269. LW.C0 = clerp(LW.C0, CFrame.new(-.15, 0.3, -.65) * angles(math.rad(80), math.rad(0), math.rad(53)- RootPart.RotVelocity.Y / 32),.2)
  1270. Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(0),math.rad(0),math.rad(0)),.25)
  1271. end
  1272.  
  1273. if aim == false and torvel>28 then
  1274. cam.FieldOfView = lerp(cam.FieldOfView, 120, 0.076)
  1275. Humanoid.CameraOffset = Humanoid.CameraOffset:lerp(Vector3.new(0+0.67*math.cos(sine/6),0+0.44*math.sin(sine/3),0),0.15)
  1276. RW.C0 = clerp(RW.C0, CFrame.new(0.95, 0.4, -0.2) * angles(math.rad(60), math.rad(0), math.rad(0)+RootPart.RotVelocity.Y / 16),.2)
  1277. LW.C0 = clerp(LW.C0, CFrame.new(-.15, 0.3, -.65) * angles(math.rad(30), math.rad(0), math.rad(53)- RootPart.RotVelocity.Y / 32),.2)
  1278. Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(12),math.rad(0),math.rad(-16)),.25)
  1279. end
  1280.  
  1281. if aim == true then
  1282. cam.FieldOfView = lerp(cam.FieldOfView, 80, 0.076)
  1283.  
  1284. Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(17),math.rad(14),math.rad(0)),.34)
  1285. RW.C0 = clerp(RW.C0, CFrame.new(0, 0.33, -0.7) * angles(math.rad(90), math.rad(0), math.rad(0)+RootPart.RotVelocity.Y / 16),.34)
  1286. LW.C0 = clerp(LW.C0, CFrame.new(-.65, 0.33, -1.15) * angles(math.rad(80), math.rad(0), math.rad(37)- RootPart.RotVelocity.Y / 32),.34)
  1287. end
  1288.  
  1289. if aim == true and torvel>1 then
  1290. Humanoid.CameraOffset = Humanoid.CameraOffset:lerp(Vector3.new(0+0.17*math.cos(sine/8),0+0.14*math.sin(sine/4),0),0.15)
  1291. Torso.Neck.C0 = clerp(Torso.Neck.C0,necko *angles(math.rad(17),math.rad(14),math.rad(0)),.34)
  1292. RW.C0 = clerp(RW.C0, CFrame.new(0, 0.33, -0.7) * angles(math.rad(90), math.rad(0), math.rad(0)+RootPart.RotVelocity.Y / 16),.34)
  1293. LW.C0 = clerp(LW.C0, CFrame.new(-.65, 0.33, -1.15) * angles(math.rad(80), math.rad(0), math.rad(37)- RootPart.RotVelocity.Y / 32),.34)
  1294. end
  1295. end
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312. if 0 < #Effects then
  1313. for e = 1, #Effects do
  1314. if Effects[e] ~= nil then
  1315. local Thing = Effects[e]
  1316. if Thing ~= nil then
  1317. local Part = Thing[1]
  1318. local Mode = Thing[2]
  1319. local Delay = Thing[3]
  1320. local IncX = Thing[4]
  1321. local IncY = Thing[5]
  1322. local IncZ = Thing[6]
  1323. if Thing[2] == "CylinderClang" then
  1324. if Thing[3] <= 1 then
  1325. Thing[1].CFrame = Thing[1].CFrame * CFrame.new(0, 2.5 * Thing[5], 0) * CFrame.fromEulerAnglesXYZ(Thing[6], 0, 0)
  1326. Thing[7] = Thing[1].CFrame
  1327. effect("New Yeller", 0, Thing[8], Thing[7])
  1328. Thing[8] = Thing[7]
  1329. Thing[3] = Thing[3] + Thing[4]
  1330. else
  1331. Part.Parent = nil
  1332. table.remove(Effects, e)
  1333. end
  1334. end
  1335. if Thing[2] == "showDamage" then
  1336. if Thing[6] < Thing[5] then
  1337. Thing[6] = Thing[6] + 1
  1338. else
  1339. if Thing[6] < Thing[7] then
  1340. Thing[4].position = Thing[4].position + vt(0, -0.2, 0)
  1341. Thing[6] = Thing[6] + 1
  1342. else
  1343. if Thing[6] < Thing[8] then
  1344. Thing[6] = Thing[6] + 1
  1345. else
  1346. if Thing[6] < Thing[9] then
  1347. Thing[6] = Thing[6] + 1
  1348. Thing[4].position = Thing[4].position + vt(0, 0.2, 0)
  1349. Thing[3].TextStrokeTransparency = Thing[3].TextStrokeTransparency + 0.1
  1350. Thing[3].TextTransparency = Thing[3].TextTransparency + 0.1
  1351. else
  1352. Thing[1].Parent = nil
  1353. table.remove(Effects, e)
  1354. end
  1355. end
  1356. end
  1357. end
  1358. end
  1359. if Thing[2] == "PartiEmi" then
  1360. Thing[3] = Thing[3] - 1
  1361. if Thing[3] <= 0 then
  1362. Thing[1].Enabled = false
  1363. table.remove(Effects, e)
  1364. end
  1365. end
  1366. if Thing[2] == "AdjuEff" then
  1367. if 0 < Thing[3] then
  1368. Thing[3] = Thing[3] - 1
  1369. Thing[1].Size = Thing[1].Size + UDim2.new(0.2, 0, 0.2, 0)
  1370. Thing[1].StudsOffset = Thing[1].StudsOffset + vt(0, -0.2, 0)
  1371. Thing[4].ImageTransparency = Thing[4].ImageTransparency + 0.1
  1372. else
  1373. Thing[1].Parent = nil
  1374. table.remove(Effects, e)
  1375. end
  1376. end
  1377. if Thing[2] ~= "Shoot" and Thing[2] ~= "DecreaseStat" and Thing[2] ~= "Wave" and Thing[2] ~= "FireWave" and Thing[2] ~= "showDamage" and Thing[2] ~= "PartiEmi" and Thing[2] ~= "AdjuEff" then
  1378. if Thing[1].Transparency <= 1 then
  1379. if Thing[2] == "Block1" then
  1380. Thing[1].CFrame = Thing[1].CFrame * euler(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50))
  1381. Mesh = Thing[7]
  1382. Mesh.Scale = Mesh.Scale + vt(Thing[4], Thing[5], Thing[6])
  1383. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  1384. else
  1385. if Thing[2] == "Block2" then
  1386. Thing[1].CFrame = Thing[1].CFrame
  1387. Mesh = Thing[7]
  1388. Mesh.Scale = Mesh.Scale + vt(Thing[4], Thing[5], Thing[6])
  1389. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  1390. else
  1391. if Thing[2] == "Block3" then
  1392. Thing[9] = Thing[9] + 0.5
  1393. Thing[1].CFrame = Thing[8] * cf(0, Thing[9], 0)
  1394. Thing[1].CFrame = Thing[1].CFrame * euler(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50))
  1395. Mesh = Thing[7]
  1396. Mesh.Scale = Mesh.Scale + vt(Thing[4], Thing[5], Thing[6])
  1397. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  1398. else
  1399. if Thing[2] == "Skull" then
  1400. Thing[1].CFrame = Thing[1].CFrame * cf(0, Thing[8] / 2, -Thing[8])
  1401. Mesh = Thing[7]
  1402. Mesh.Scale = Mesh.Scale + vt(Thing[4], Thing[5], Thing[6])
  1403. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  1404. else
  1405. if Thing[2] == "Cylinder" then
  1406. Mesh = Thing[7]
  1407. Mesh.Scale = Mesh.Scale + vt(Thing[4], Thing[5], Thing[6])
  1408. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  1409. else
  1410. if Thing[2] == "Cylinder2" then
  1411. Thing[1].CFrame = Thing[1].CFrame * cf(0, Thing[8], 0)
  1412. Mesh = Thing[7]
  1413. Mesh.Scale = Mesh.Scale + vt(Thing[4], Thing[5], Thing[6])
  1414. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  1415. else
  1416. if Thing[2] == "Blood" then
  1417. Mesh = Thing[7]
  1418. Thing[1].CFrame = Thing[1].CFrame * cf(0, 0.5, 0)
  1419. Mesh.Scale = Mesh.Scale + vt(Thing[4], Thing[5], Thing[6])
  1420. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  1421. else
  1422. if Thing[2] == "Elec" then
  1423. Mesh = Thing[10]
  1424. Mesh.Scale = Mesh.Scale + vt(Thing[7], Thing[8], Thing[9])
  1425. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  1426. else
  1427. if Thing[2] == "Disappear" then
  1428. Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  1429. end
  1430. end
  1431. end
  1432. end
  1433. end
  1434. end
  1435. end
  1436. end
  1437. end
  1438. else
  1439. Part.Parent = nil
  1440. table.remove(Effects, e)
  1441. end
  1442. end
  1443. end
  1444. end
  1445. end
  1446. end
  1447.  
  1448.  
  1449. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement