Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.42 KB | None | 0 0
  1. print"Loading"
  2. --script=Instance.new("LocalScript")
  3.  
  4. local UIS = game:GetService("UserInputService")
  5.  
  6. local Player = game.Players.LocalPlayer
  7. local Mouse = Player:GetMouse()
  8.  
  9.  
  10. function GetCharacter()
  11. return game.Players.LocalPlayer.Character
  12. end
  13.  
  14. function Teleport(pos)
  15. local Char = GetCharacter()
  16. if Char then
  17. Char:MoveTo(pos)
  18. end
  19. end
  20.  
  21.  
  22. UIS.InputBegan:Connect(function(input)
  23. if input.UserInputType == Enum.UserInputType.MouseButton1 and UIS:IsKeyDown(Enum.KeyCode.LeftControl) then
  24. Teleport(Mouse.Hit.p)
  25. end
  26. end)
  27.  
  28.  
  29.  
  30.  
  31. local source = [[
  32. function GetM9()
  33. local m9 = game.Players.LocalPlayer.Backpack:FindFirstChild("M9")
  34. if m9 then
  35. return m9
  36. else
  37. return game.Players.LocalPlayer.Character:FindFirstChild("M9")
  38. end
  39. end
  40. repeat wait() until GetM9().ClassName == "Tool"
  41.  
  42. local Player = game.Players.LocalPlayer
  43. local Mouse = Player:GetMouse()
  44. local Character = game.Workspace:WaitForChild(Player.Name)
  45. local Humanoid = Character:WaitForChild("Humanoid")
  46.  
  47.  
  48.  
  49.  
  50. local Data = {
  51. Damages = {
  52. Head = 30,
  53. Torso = 25,
  54. Else = 20
  55. },
  56. FireRate = 1/11,
  57. ReloadTime = 0.1,
  58. ClipSize = 350,
  59. Accuracy = 10,
  60. NumBullets = 1,
  61. FireMode = "Auto",
  62. Range = 1000,
  63. BarrelOffset = CFrame.new(0,.25,-.7)
  64. }
  65.  
  66. function F1R3(Human, dmg)
  67. for i = 1,4 do
  68. game.ReplicatedStorage.Remotes.Damage:FireServer("xHyf86e", dmg, Human, GetM9())
  69. end
  70. end
  71.  
  72. local Equipped = false
  73. local Firing = false
  74. local Reloading = false
  75. local CanFire = true
  76. local Ammo = Data["ClipSize"]
  77.  
  78. local GunUI = script:WaitForChild("GunUI")
  79. GunUI.AmmoBack.Ammo.Text = Ammo .. " / " .. Ammo
  80.  
  81. local UIS = game:GetService("UserInputService")
  82.  
  83. local GoldIDs = {
  84. M9 = 316022948,
  85. Scorpion = 316250295,
  86. Shotgun = 317302030,
  87. Sniper = 316598801,
  88. ["AK-47"] = 317301580,
  89. ["M-16"] = 317302215
  90. }
  91.  
  92.  
  93. game.ReplicatedStorage.Remotes.Goldify:FireServer(GetM9():WaitForChild("Handle"))
  94.  
  95. function gunUItext(text) --Im that lazy
  96. GunUI.AmmoBack.Ammo.Text = text
  97. end
  98. GunUI.AmmoBack.Ammo.TextColor3 = Color3.new(0, 0, 255)
  99. function Reload()
  100. Reloading = true
  101. GetM9().Handle.ReloadSound:Play()
  102. gunUItext("-- / --")
  103. wait(Data["ReloadTime"])
  104. Ammo = Data["ClipSize"]
  105. gunUItext(Ammo .. " / " .. Ammo)
  106. Reloading = false
  107. end
  108.  
  109. local igList = {game.Workspace:WaitForChild(Player.Name),unpack(game.Workspace.Map.BulletStorage:GetChildren()),game.Workspace.Map}
  110.  
  111. function CastRay(OldPos)
  112.  
  113. local function getBodyDamage(bP)
  114. if bP.Name == "Head" then
  115. return "Head"
  116. elseif bP.Name == "Torso" then
  117. return "Torso"
  118. else
  119. return "Else"
  120. end
  121. end
  122.  
  123. local function evenOrodd()
  124. if math.random(1,2) == 1 then
  125. return 1
  126. else
  127. return -1
  128. end
  129. end
  130.  
  131. local ray
  132. if OldPos then
  133. ray = Ray.new(Player.Character.Head.CFrame.p,(OldPos - Player.Character.Head.CFrame.p).unit * Data["Range"])
  134. else
  135. local Eq = ((math.random(-Data["Accuracy"],Data["Accuracy"])/100) * (Player.Character.Head.CFrame.p - Mouse.Hit.p).magnitude * .01)
  136. local tempEq = Mouse.Hit * CFrame.new(Eq * evenOrodd(),Eq * evenOrodd(),Eq * evenOrodd())
  137. ray = Ray.new(Player.Character.Head.CFrame.p,((tempEq).p - Player.Character.Head.CFrame.p).unit * Data["Range"])
  138. end
  139. local hit, position = game.Workspace:FindPartOnRayWithIgnoreList(ray, igList)
  140.  
  141. local rayP = Instance.new("Part")
  142. rayP.Parent = Character
  143. rayP.Size = Vector3.new(.2,.2,((GetM9().Handle.CFrame * Data["BarrelOffset"]).p - position).magnitude)
  144. rayP.Anchored = true
  145. rayP.CanCollide = false
  146. rayP.Transparency = .75
  147. rayP.CFrame = CFrame.new((GetM9().Handle.CFrame * Data["BarrelOffset"]).p,position) * CFrame.new(0,0,rayP.Size.Z/-2)
  148.  
  149. local dat = Player:FindFirstChild("Data")
  150. if dat then
  151. rayP.BrickColor = BrickColor.new("Institutional white")
  152. if rayP.BrickColor ~= BrickColor.new("Medium stone grey") then
  153. rayP.Material = "Neon"
  154. rayP.Transparency = 0
  155. end
  156. end
  157.  
  158. local msh = Instance.new("BlockMesh")
  159. msh.Parent = rayP
  160. msh.Scale = Vector3.new(.25,.25,1)
  161.  
  162. game.ReplicatedStorage.Remotes.ServerGun:FireServer(rayP.CFrame, rayP.Size, rayP.BrickColor, GetM9():WaitForChild("Handle"))
  163.  
  164. if hit then
  165. local Human = hit.Parent:FindFirstChild("Humanoid") or hit.Parent.Parent:FindFirstChild("Humanoid")
  166. if Human and Humanoid.Health > 0 and Human ~= Humanoid then
  167. if hit.Parent:FindFirstChild("Humanoid") then
  168. F1R3(Human, Data["Damages"][getBodyDamage(hit)])
  169. else
  170. if hit.Parent.ClassName == "Accessory" then
  171. F1R3(Human, Data["Damages"]["Head"])
  172. elseif hit.Parent.ClassName == "Tool" then
  173. F1R3(Human, Data["Damages"]["Else"])
  174. end
  175. end
  176. end
  177. end
  178.  
  179. spawn(function()
  180. for i = rayP.Transparency,1,.05 do
  181. wait(.05)
  182. rayP.Transparency = i
  183. end
  184. rayP:Destroy()
  185. end)
  186.  
  187. end
  188.  
  189. GetM9().Equipped:Connect(function(M)
  190.  
  191. Equipped = true
  192. GunUI.Parent = Player.PlayerGui
  193. M.Icon = "rbxassetid://76603102"
  194.  
  195. M.Button1Down:Connect(function()
  196.  
  197. Firing = true
  198.  
  199. if Ammo <= 0 and not Reloading then
  200. Reload()
  201. end
  202.  
  203. if Data["FireMode"] == "Auto" then
  204. if Equipped and not Reloading and Firing and Humanoid.Health > 0 then
  205. if Ammo > 0 then
  206. repeat
  207. wait(Data["FireRate"])
  208. Ammo = Ammo - 1
  209. for i = 1,Data["NumBullets"] do
  210. CastRay()
  211. end
  212. gunUItext(Ammo .. " / " .. Data["ClipSize"])
  213. GetM9().Handle.ShotSound:Play()
  214. until Ammo <= 0 or Reloading or not Firing or Humanoid.Health <= 0 or not Equipped
  215. wait()
  216. if Ammo <= 0 then
  217. repeat
  218. wait(Data["FireRate"])
  219. GetM9().Handle.EmptySound:Play()
  220. until Reloading or not Firing or not Equipped
  221. end
  222. end
  223. end
  224. else
  225. if Equipped and not Reloading and Firing and Humanoid.Health > 0 then
  226. if Ammo > 0 then
  227. if CanFire then
  228. CanFire = false
  229. Ammo = Ammo - 1
  230. for i = 1,Data["NumBullets"] do
  231. CastRay()
  232. end
  233. gunUItext(Ammo .. " / " .. Data["ClipSize"])
  234. GetM9().Handle.ShotSound:Play()
  235. wait(Data["FireRate"])
  236. CanFire = true
  237. end
  238. end
  239. end
  240. end
  241.  
  242. end)
  243.  
  244. M.Button1Up:Connect(function()
  245. Firing = false
  246. end)
  247.  
  248. end)
  249.  
  250. GetM9().Unequipped:Connect(function(M)
  251. Equipped = false
  252. GunUI.Parent = script
  253. end)
  254.  
  255. UIS.InputBegan:Connect(function(Key)
  256. if Equipped then
  257. if Key.KeyCode == Enum.KeyCode.R and not Reloading then
  258. Reload()
  259. end
  260. end
  261. end)]]
  262.  
  263.  
  264. function run()
  265. loadstring(source)()
  266. end
  267.  
  268.  
  269. function bypass()
  270. spawn(function()
  271. local m9 = game.Players.LocalPlayer.Backpack:WaitForChild("M9")
  272. local s = m9:FindFirstChild("GunClient")
  273. if s then
  274. s.Disabled = true
  275. for i,v in pairs(s:children())do
  276. if v then
  277. v = v:Clone()
  278. v.Parent = script
  279. end
  280. end
  281. wait()
  282. s:Destroy()
  283. wait()
  284. run()
  285. end
  286. end)
  287. end
  288.  
  289. bypass()
  290. game.Players.LocalPlayer.CharacterAdded:Connect(bypass)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement