Advertisement
samuelrichter66

fps gun

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