Advertisement
samuelrichter66

FPS M1911

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