Advertisement
Roblox_Xploits

brge

Nov 5th, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.56 KB | None | 0 0
  1.  
  2. --Converted with ttyyuu12345's model to script plugin v4
  3. function sandbox(var,func)
  4. local env = getfenv(func)
  5. local newenv = setmetatable({},{
  6. __index = function(self,k)
  7. if k=="script" then
  8. return var
  9. else
  10. return env[k]
  11. end
  12. end,
  13. })
  14. setfenv(func,newenv)
  15. return func
  16. end
  17. cors = {}
  18. mas = Instance.new("Model",game:GetService("Lighting"))
  19. Tool0 = Instance.new("Tool")
  20. Sound1 = Instance.new("Sound")
  21. NumberValue2 = Instance.new("NumberValue")
  22. Animation3 = Instance.new("Animation")
  23. Animation4 = Instance.new("Animation")
  24. ScreenGui5 = Instance.new("ScreenGui")
  25. TextLabel6 = Instance.new("TextLabel")
  26. LocalScript7 = Instance.new("LocalScript")
  27. TextLabel8 = Instance.new("TextLabel")
  28. LocalScript9 = Instance.new("LocalScript")
  29. Animation10 = Instance.new("Animation")
  30. Part11 = Instance.new("Part")
  31. Script12 = Instance.new("Script")
  32. Tool0.Name = "Deagle"
  33. Tool0.Parent = mas
  34. Tool0.GripForward = Vector3.new(-0.999229848, -0.0209334791, -0.0331904814)
  35. Tool0.GripPos = Vector3.new(2.00845313, -0.593266726, -0.0581263378)
  36. Tool0.GripRight = Vector3.new(0.0327064507, 0.023055179, -0.999199033)
  37. Tool0.GripUp = Vector3.new(-0.0216819271, 0.999515057, 0.0223527625)
  38. Sound1.Name = "Gunfire"
  39. Sound1.Parent = Tool0
  40. NumberValue2.Name = "Bullets"
  41. NumberValue2.Parent = Tool0
  42. NumberValue2.Value = 35
  43. Animation3.Name = "reload"
  44. Animation3.Parent = Tool0
  45. Animation3.AnimationId = "rbxassetid://1132295325"
  46. Animation4.Name = "shoot"
  47. Animation4.Parent = Tool0
  48. Animation4.AnimationId = "rbxassetid://1133088820"
  49. ScreenGui5.Name = "GunGUI"
  50. ScreenGui5.Parent = Tool0
  51. TextLabel6.Name = "Bullets"
  52. TextLabel6.Parent = ScreenGui5
  53. TextLabel6.Transparency = 0.60000002384186
  54. TextLabel6.Size = UDim2.new(0, 200, 0, 50)
  55. TextLabel6.Text = "NiL/NiL"
  56. TextLabel6.Position = UDim2.new(0.5, -100, 0.800000012, -25)
  57. TextLabel6.BackgroundColor3 = Color3.new(0, 0, 0)
  58. TextLabel6.BackgroundTransparency = 0.60000002384186
  59. TextLabel6.BorderSizePixel = 0
  60. TextLabel6.SizeConstraint = Enum.SizeConstraint.RelativeYY
  61. TextLabel6.Font = Enum.Font.SciFi
  62. TextLabel6.FontSize = Enum.FontSize.Size48
  63. TextLabel6.TextColor3 = Color3.new(1, 1, 1)
  64. TextLabel6.TextScaled = true
  65. TextLabel6.TextWrapped = true
  66. LocalScript7.Parent = TextLabel6
  67. table.insert(cors,sandbox(LocalScript7,function()
  68. local bullets = game.Workspace:WaitForChild(game.Players.LocalPlayer.Name) :WaitForChild("Deagle").Bullets
  69. script.Parent.Text = bullets.Value.."/35"
  70. bullets.Changed:Connect(function()
  71. if bullets.Value == 0 then
  72. script.Parent.Text = "Press 'r' to reload"
  73. else
  74. script.Parent.Text = bullets.Value.."/35"
  75. end
  76. end)
  77. end))
  78. TextLabel8.Name = "Headshot"
  79. TextLabel8.Parent = ScreenGui5
  80. TextLabel8.Transparency = 1
  81. TextLabel8.Size = UDim2.new(0, 600, 0, 50)
  82. TextLabel8.Text = ""
  83. TextLabel8.Position = UDim2.new(1.5, 0, 0.5, -25)
  84. TextLabel8.BackgroundColor3 = Color3.new(1, 0.933333, 0)
  85. TextLabel8.BackgroundTransparency = 1
  86. TextLabel8.Font = Enum.Font.SciFi
  87. TextLabel8.FontSize = Enum.FontSize.Size60
  88. TextLabel8.TextColor3 = Color3.new(1, 0.933333, 0)
  89. TextLabel8.TextScaled = true
  90. TextLabel8.TextWrapped = true
  91. LocalScript9.Parent = Tool0
  92. table.insert(cors,sandbox(LocalScript9,function()
  93. local tool = script.Parent -- Getting the tool
  94. local plr = game.Players.LocalPlayer
  95. local player = game:GetService("Players").LocalPlayer -- Getting the player
  96. local mouse = player:GetMouse() -- Getting the mouse
  97. local sound = tool:WaitForChild("Gunfire")
  98. local torso = "" -- Nothing for now.
  99. local reloading = false -- Variable to check if we are currently reloading
  100. local contextActionService = game:GetService("ContextActionService") -- Allow us to cater for Mobile players
  101. local bodytype = nil -- Nil for now but will check whether player is R6 or R15
  102. local difference = 0 -- Difference between position of head and mouse
  103. local replicatedstorage = game:GetService("ReplicatedStorage")
  104. local gungui = tool:WaitForChild("GunGUI")
  105. local bullets = tool:WaitForChild("Bullets")
  106. local reloadtime = 3
  107. -- Remote Events
  108. local equipAnimation = replicatedstorage:WaitForChild("EquipAnimation")
  109. local headshot = replicatedstorage:WaitForChild("Headshot")
  110. local reload2 = replicatedstorage:WaitForChild("Reload")
  111. local shootevent = replicatedstorage:WaitForChild("ShootEvent")
  112. local unequipanimation = replicatedstorage:WaitForChild("UnequipAnimation")
  113. local gunshot = script.Parent.gunshot
  114. -- Remote Functions
  115. local checkBodyType = replicatedstorage:WaitForChild("CheckBodyType")
  116. local fetchBulletsLeft = replicatedstorage:WaitForChild("FetchBulletsLeft")
  117. -- Find Body Type
  118. function findBodyType() -- Used to determine whether a player is R6 or R15
  119. bodytype = checkBodyType:InvokeServer(tool) -- Invoking the Remotefunction to do a check on the server
  120. print(bodytype)
  121. end
  122.  
  123. -- Reloading function
  124. function reload()
  125. reloading = true
  126. reload2:FireServer(tool.reload)
  127. mouse.Icon = "http://www.roblox.com/asset?id="
  128. player.PlayerGui:WaitForChild("GunGUI").Bullets.Text = "Reloading..."
  129. wait(reloadtime)
  130. bullets.Value = 35
  131. player.PlayerGui:WaitForChild("GunGUI").Bullets.Text = bullets.Value.."/35"
  132. mouse.Icon = "http://www.roblox.com/asset?id="
  133. equipAnimation:FireServer(tool.shoot)
  134. reloading = false
  135. end
  136. -- When the tool is equipped, the following event will run
  137. tool.Equipped:Connect(function(mouse)
  138. gungui:Clone().Parent = player.PlayerGui -- We are cloning the Gun GUI into the player's PlayerGUI
  139. findBodyType() -- Calling the function above to check the body type.
  140. equipAnimation:FireServer(tool.shoot) -- Calling the equip animation remoteevent so that the server can play the animation
  141. mouse.Icon = "http://www.roblox.com/asset?id="
  142. mouse.Button1Down:Connect(function()
  143. if bullets.Value <=0 or reloading == true then
  144. -- Don't do anything
  145. else
  146. local head = game.Workspace[player.Name].Head.CFrame.lookVector
  147. local mouse = CFrame.new(game.Workspace[player.Name].Head.Position,mouse.Hit.p).lookVector
  148. difference = (head-mouse)
  149. local ray = Ray.new(tool.Handle.CFrame.p,(player:GetMouse().Hit.p - tool.Handle.CFrame.p).unit*300)
  150. local part,position = game.Workspace:FindPartOnRay(ray,player.Character,false,true)
  151. local shot = game.Workspace[player.Name].Humanoid:LoadAnimation(gunshot)
  152. shot:Play()
  153. sound:Play()
  154. if difference.magnitude < 1.33 then
  155. shootevent:FireServer(tool,position,part)
  156. bullets.Value = bullets.Value - 1
  157. end
  158. end
  159. end)
  160. local reloadMobileButton = contextActionService:BindAction("ReloadBtn",reload,true,"r")
  161. contextActionService:SetPosition("ReloadBtn",UDim2.new(0.72,-25,0.20,-25))
  162. contextActionService:SetImage("ReloadBtn","http://www.roblox.com/asset/?id=")
  163. end)
  164. tool.Unequipped:Connect(function()
  165. mouse.Icon = ""
  166. unequipanimation:FireServer(tool.shoot)
  167. player.PlayerGui.GunGUI:Destroy()
  168. contextActionService:UnbindAction("ReloadBtn")
  169. end)
  170. headshot.OnClientEvent:Connect(function()
  171. player.PlayerGui.GunGUI.Headshot:TweenPosition(UDim2.new(0.5,-100,0.5,-25), "Out","Quint",0.3)
  172. wait(1.5)
  173. player.PlayerGui.GunGUI.Headshot:TweenPosition(UDim2.new(-1,0,0.5,-25), "In","Quint",0.4)
  174. wait(0.5)
  175. player.PlayerGui.GunGUI.Headshot.Position = UDim2.new(1.5,0,0.5,-25)
  176. end)
  177. end))
  178. Animation10.Name = "gunshot"
  179. Animation10.Parent = Tool0
  180. Animation10.AnimationId = "rbxassetid://1133099894"
  181. Part11.Name = "Handle"
  182. Part11.Parent = Tool0
  183. Part11.Reflectance = 1
  184. Part11.Transparency = 1
  185. Part11.Size = Vector3.new(0.110000007, 0.179999933, 0.190000519)
  186. Part11.CFrame = CFrame.new(3.1850009, 1.00000429, -13.1549959, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  187. Part11.RightSurface = Enum.SurfaceType.Studs
  188. Part11.Position = Vector3.new(3.1850009, 1.00000429, -13.1549959)
  189. Script12.Name = "Weld"
  190. Script12.Parent = Tool0
  191. table.insert(cors,sandbox(Script12,function()
  192. local prev
  193. local parts = script.Parent:GetChildren()
  194. for i = 1,#parts do
  195. if ((parts[i].className == "Part") or (parts[i].className == "Handle") or (parts[i].className == "WedgePart") or (parts[i].className == "Seat") or (parts[i].className == "TrussPart") or (parts[i].className == "VehicleSeat") or (parts[i].className == "UnionOperation") or (parts[i].className == "SkateboardPlatform")) then
  196. if (prev ~= nil) then
  197. local weld = Instance.new("Weld")
  198. weld.Part0 = prev
  199. weld.Part1 = parts[i]
  200. weld.C0 = prev.CFrame:inverse()
  201. weld.C1 = parts[i].CFrame:inverse()
  202. weld.Parent = prev
  203. parts[i].Anchored = false
  204. end
  205. prev = parts[i]
  206. end
  207. end
  208. wait(3)
  209.  
  210.  
  211. end))
  212. for i,v in pairs(mas:GetChildren()) do
  213. v.Parent = game:GetService("Players").LocalPlayer.Backpack
  214. pcall(function() v:MakeJoints() end)
  215. end
  216. mas:Destroy()
  217. for i,v in pairs(cors) do
  218. spawn(function()
  219. pcall(v)
  220. end)
  221. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement