briannovius

Untitled

Nov 1st, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.58 KB | None | 0 0
  1. --SynapseX Decompiler
  2. gun = nil
  3. equipped = false
  4. ready = true
  5. jumping = false
  6. GUI = script.Parent
  7. aiming = false
  8. reloads = {
  9. true,
  10. true,
  11. true,
  12. true,
  13. true
  14. }
  15. rlt = 0
  16. local nCC = 0
  17. local CC = script.Parent:GetChildren()
  18. for cc = 1, #CC do
  19. if CC[cc].Name == "GunScript" then
  20. nCC = nCC + 1
  21. end
  22. end
  23. if script.Parent.Name ~= "GameGui" or nCC > 1 or script.Name ~= "GunScript" then
  24. script:Destroy()
  25. end
  26. game.ReplicatedStorage.RemoteFunctionz.Items.EquipGun.OnClientEvent:connect(function(bool)
  27. if bool then
  28. equipped = true
  29. gun = bool
  30. reloading = false
  31. script.Parent.WeaponButtons.Attack1.Text = "Aim"
  32. script.Parent.WeaponButtons.Attack2.Text = "Fire"
  33. script.Parent.WeaponButtons.Attack2.Visible = false
  34. if script.Parent.OnMobile.Value then
  35. script.Parent.WeaponButtons.Visible = true
  36. end
  37. elseif equipped then
  38. equipped = false
  39. gun = nil
  40. game:GetService("UserInputService").MouseIconEnabled = true
  41. script.Parent.Crosshairs.Visible = false
  42. game.Players.LocalPlayer.CameraMode = Enum.CameraMode.Classic
  43. aiming = false
  44. script.Parent.WeaponButtons.Visible = false
  45. script.Parent.FLM:Fire(1)
  46. end
  47. end)
  48. wait(5)
  49. MOUSE = game.Players.LocalPlayer:GetMouse()
  50. function Reload()
  51. reloading = true
  52. rlt = rlt + 1
  53. local rltime = rlt
  54. local oslot = gun.Slot.Value
  55. if game.Players:FindFirstChild("Nahr_Nahrstein") and gun and gun:findFirstChild("ReloadOverride") then
  56. if gun and gun.Slot.Value == oslot and rlt == rltime then
  57. reloads[gun.Slot.Value] = true
  58. reloading = false
  59. if gun:findFirstChild("Bolt") then
  60. gun.Bolt.Transparency = 0
  61. end
  62. end
  63. else
  64. if gun then
  65. script.Parent.FLM:Fire(0.5)
  66. game.ReplicatedStorage.RemoteFunctionz.Gear.Animation:FireServer(gun.AimAnim, gun.ReloadAnim, gun.Flash.Reload)
  67. end
  68. wait(6)
  69. if gun and gun.Slot.Value == oslot and rlt == rltime then
  70. script.Parent.FLM:Fire(1)
  71. reloads[gun.Slot.Value] = true
  72. game.ReplicatedStorage.RemoteFunctionz.Gear.Animation:FireServer(nil, gun.GearIdleAnim)
  73. reloading = false
  74. if gun:findFirstChild("Bolt") then
  75. gun.Bolt.Transparency = 0
  76. end
  77. end
  78. end
  79. end
  80. game:GetService("UserInputService").InputBegan:connect(function(input, b)
  81. if not equipped or not ready then
  82. return
  83. end
  84. local code = input.KeyCode
  85. if input.UserInputType == Enum.UserInputType.MouseButton1 and reloads[gun.Slot.Value] and aiming and game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Y > 1.5 then
  86. ready = false
  87. game.ReplicatedStorage.RemoteFunctionz.Ships.FireGun:FireServer(game.Players.LocalPlayer.Character:findFirstChild("ActiveGear"), workspace.CurrentCamera.CFrame.p + workspace.CurrentCamera.CFrame.lookVector * 100)
  88. aiming = false
  89. game:GetService("UserInputService").MouseIconEnabled = true
  90. script.Parent.Crosshairs.Visible = false
  91. game.Players.LocalPlayer.CameraMode = Enum.CameraMode.Classic
  92. reloads[gun.Slot.Value] = false
  93. if gun:findFirstChild("Bolt") then
  94. gun.Bolt.Transparency = 1
  95. end
  96. if game.Players:FindFirstChild("Nahr_Nahrstein") and gun and gun:findFirstChild("ReloadOverride") then
  97. wait(0.15)
  98. aiming = true
  99. else
  100. wait(1)
  101. end
  102. ready = true
  103. Reload()
  104. elseif input.UserInputType == Enum.UserInputType.MouseButton2 then
  105. if reloads[gun.Slot.Value] then
  106. ready = false
  107. aiming = true
  108. script.Parent.FLM:Fire(0.5)
  109. game:GetService("UserInputService").MouseIconEnabled = false
  110. script.Parent.Crosshairs.Visible = true
  111. game.Players.LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
  112. if gun.Flash:findFirstChild("Click") then
  113. game.ReplicatedStorage.RemoteFunctionz.Gear.Animation:FireServer(gun.GearIdleAnim, gun.AimAnim, gun.Flash.Click)
  114. else
  115. game.ReplicatedStorage.RemoteFunctionz.Gear.Animation:FireServer(gun.GearIdleAnim, gun.AimAnim)
  116. end
  117. wait(0.3)
  118. ready = true
  119. elseif not reloading then
  120. Reload()
  121. end
  122. elseif code == Enum.KeyCode.F then
  123. if aiming then
  124. ready = false
  125. aiming = false
  126. script.Parent.FLM:Fire(1)
  127. game:GetService("UserInputService").MouseIconEnabled = true
  128. script.Parent.Crosshairs.Visible = false
  129. game.ReplicatedStorage.RemoteFunctionz.Gear.Animation:FireServer(gun.AimAnim, gun.GearIdleAnim)
  130. game.Players.LocalPlayer.CameraMode = Enum.CameraMode.Classic
  131. wait(0.15)
  132. ready = true
  133. elseif reloads[gun.Slot.Value] then
  134. ready = false
  135. aiming = true
  136. script.Parent.FLM:Fire(0.5)
  137. game:GetService("UserInputService").MouseIconEnabled = false
  138. script.Parent.Crosshairs.Visible = true
  139. game.Players.LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
  140. if gun.Flash:findFirstChild("Click") then
  141. game.ReplicatedStorage.RemoteFunctionz.Gear.Animation:FireServer(gun.GearIdleAnim, gun.AimAnim, gun.Flash.Click)
  142. else
  143. game.ReplicatedStorage.RemoteFunctionz.Gear.Animation:FireServer(gun.GearIdleAnim, gun.AimAnim)
  144. end
  145. wait(0.15)
  146. ready = true
  147. elseif not reloading then
  148. Reload()
  149. end
  150. end
  151. end)
  152. game:GetService("UserInputService").InputEnded:connect(function(input, b)
  153. if not equipped then
  154. return
  155. end
  156. local code = input.KeyCode
  157. if input.UserInputType == Enum.UserInputType.MouseButton2 and aiming then
  158. ready = false
  159. aiming = false
  160. script.Parent.FLM:Fire(1)
  161. game:GetService("UserInputService").MouseIconEnabled = true
  162. script.Parent.Crosshairs.Visible = false
  163. game.ReplicatedStorage.RemoteFunctionz.Gear.Animation:FireServer(gun.AimAnim, gun.GearIdleAnim)
  164. game.Players.LocalPlayer.CameraMode = Enum.CameraMode.Classic
  165. wait(0.15)
  166. ready = true
  167. end
  168. end)
  169. script.Parent.WeaponButtons.Attack1.MouseButton1Down:connect(function()
  170. if not gun then
  171. return
  172. end
  173. if aiming then
  174. ready = false
  175. aiming = false
  176. script.Parent.WeaponButtons.Attack2.Visible = false
  177. script.Parent.FLM:Fire(1)
  178. game:GetService("UserInputService").MouseIconEnabled = true
  179. script.Parent.Crosshairs.Visible = false
  180. game.ReplicatedStorage.RemoteFunctionz.Gear.Animation:FireServer(gun.AimAnim, gun.GearIdleAnim)
  181. game.Players.LocalPlayer.CameraMode = Enum.CameraMode.Classic
  182. wait(0.15)
  183. ready = true
  184. elseif reloads[gun.Slot.Value] then
  185. ready = false
  186. aiming = true
  187. script.Parent.WeaponButtons.Attack2.Visible = true
  188. script.Parent.FLM:Fire(0.5)
  189. game:GetService("UserInputService").MouseIconEnabled = false
  190. script.Parent.Crosshairs.Visible = true
  191. game.Players.LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
  192. if gun.Flash:findFirstChild("Click") then
  193. game.ReplicatedStorage.RemoteFunctionz.Gear.Animation:FireServer(gun.GearIdleAnim, gun.AimAnim, gun.Flash.Click)
  194. else
  195. game.ReplicatedStorage.RemoteFunctionz.Gear.Animation:FireServer(gun.GearIdleAnim, gun.AimAnim)
  196. end
  197. wait(0.15)
  198. ready = true
  199. elseif not reloading then
  200. Reload()
  201. end
  202. end)
  203. script.Parent.WeaponButtons.Attack2.MouseButton1Down:connect(function()
  204. if not equipped or not aiming then
  205. return
  206. end
  207. if reloads[gun.Slot.Value] and aiming and game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Y > 1.5 then
  208. ready = false
  209. game.ReplicatedStorage.RemoteFunctionz.Ships.FireGun:FireServer(game.Players.LocalPlayer.Character:findFirstChild("ActiveGear"), workspace.CurrentCamera.CFrame.p + workspace.CurrentCamera.CFrame.lookVector * 100)
  210. aiming = false
  211. game:GetService("UserInputService").MouseIconEnabled = true
  212. script.Parent.Crosshairs.Visible = false
  213. game.Players.LocalPlayer.CameraMode = Enum.CameraMode.Classic
  214. reloads[gun.Slot.Value] = false
  215. if gun:findFirstChild("Bolt") then
  216. gun.Bolt.Transparency = 1
  217. end
  218. script.Parent.WeaponButtons.Attack2.Visible = false
  219. wait(1)
  220. ready = true
  221. Reload()
  222. end
  223. end)
Add Comment
Please, Sign In to add comment