Advertisement
lafur

Untitled

Sep 8th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.44 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,Mouse,mouse,UserInputService,ContextActionService = owner
  4. local RealPlayer = Player
  5. do print("FE Compatibility code by Mokiros")local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c(),Button2Up=c(),Button2Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;if o.UserInputType==Enum.UserInputType.MouseButton2 then return f:TrigEvent(p and"Button2Down"or"Button2Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return typeof(t[q])=="function"and function(m,...)return t[q](t,...)end or t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return rawget(self,t)or r:GetService(t)end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService"),RunService=v({_btrs={},RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;v(x,game)game,owner=x,x.Players.LocalPlayer end Character = game.Players.LocalPlayer.Character
  6. Player = game.Players.LocalPlayer
  7. char = Character
  8. hum = Character.Humanoid
  9. Torso = Character.Torso
  10. Head = Character.Head
  11.  
  12. char.Shirt.ShirtTemplate = "rbxassetid://994469018"
  13. char.Pants.PantsTemplate = "rbxassetid://977437883"
  14.  
  15.  
  16. local BC = char["Body Colors"]
  17. BC.HeadColor = BrickColor.new("Really black")
  18. BC.LeftArmColor = BrickColor.new("Really black")
  19. BC.LeftLegColor = BrickColor.new("Really black")
  20. BC.RightArmColor = BrickColor.new("Really black")
  21. BC.RightLegColor = BrickColor.new("Really black")
  22. BC.TorsoColor = BrickColor.new("Really black")
  23.  
  24. char.Head.face.Texture = "rbxassetid://701379058"
  25.  
  26. hum.MaxHealth = math.huge
  27.  
  28.  
  29.  
  30.  
  31. for i,v in pairs(char:children()) do
  32. if v:IsA("Hat") then
  33. v:Destroy()
  34. end
  35. end
  36. for i,v in pairs(char:children()) do
  37. if v:IsA("Accessory") then
  38. v:Destroy()
  39. end
  40. end
  41. for i,v in pairs(char:children()) do
  42. if v:IsA("Hair") then
  43. v:Destroy()
  44. end
  45. end
  46. --141378828
  47. Reaper = Instance.new("Model")
  48. Reaper.Parent = Player.Character
  49. Reaper.Name = "Reaper"
  50. rh = Instance.new("Part")
  51. rh.Parent = Reaper
  52. rh.BrickColor = BrickColor.new("Really red")
  53. rh.Locked = true
  54. rh.CanCollide = false
  55. mesh = Instance.new("SpecialMesh")
  56. rh.formFactor = "Symmetric"
  57. mesh.MeshType = "FileMesh"
  58. mesh.MeshId = "http://www.roblox.com/asset/?id=112643970"
  59. mesh.TextureId = "http://www.roblox.com/asset/?id=1018233493"
  60. mesh.Parent = rh
  61. mesh.Scale = Vector3.new(1.1,1.1,1.1)
  62. local weld = Instance.new("Weld")
  63. weld.Parent = rh
  64. rh.Transparency = 0
  65. weld.Part0 = rh
  66. weld.Part1 = Player.Character.Head
  67. weld.C0 = CFrame.new(-0, -0.05, -0)*CFrame.Angles(0, 0, 0)
  68.  
  69. local s = Instance.new("Sound",char)
  70. s.SoundId = "http://www.roblox.com/asset/?id=565420180"
  71. s.Pitch = 1
  72. s.Volume = 2
  73. s.Looped = true
  74. wait(1)
  75. s:play()
  76. local txtfag = Instance.new("BillboardGui", game.Players.LocalPlayer.Character.Head)
  77. txtfag.Adornee = suckadick
  78. txtfag.Name = "kys nigga"
  79. txtfag.Size = UDim2.new(2, 0, 1.2, 0)
  80. txtfag.StudsOffset = Vector3.new(-5, 3, 0)
  81. local textfag = Instance.new("TextLabel", txtfag)
  82. textfag.Size = UDim2.new(6, 0, 1, 0)
  83. textfag.FontSize = "Size8"
  84. textfag.TextScaled = true
  85. textfag.TextTransparency = 0
  86. textfag.BackgroundTransparency = 1
  87. textfag.TextTransparency = 0
  88. textfag.TextStrokeTransparency = 0
  89. textfag.Font = "Cartoon"
  90. textfag.TextStrokeColor3 = Color3.new(0, 0, 0)
  91. textfag.Text = game.Players.LocalPlayer.Character.Name.." the Anti-Skid "
  92.  
  93.  
  94. local runDummyScript = function(f,scri)
  95. local oldenv = getfenv(f)
  96. local newenv = setmetatable({}, {
  97. __index = function(_, k)
  98. if k:lower() == 'script' then
  99. return scri
  100. else
  101. return oldenv[k]
  102. end
  103. end
  104. })
  105. setfenv(f, newenv)
  106. ypcall(function() f() end)
  107. end
  108. cors = {}
  109. mas = Instance.new("Model",game:GetService("Lighting"))
  110. mas.Name = "CompiledModel"
  111. o1 = Instance.new("Tool")
  112. o2 = Instance.new("Part")
  113. o3 = Instance.new("SpecialMesh")
  114. o4 = Instance.new("Sound")
  115. o5 = Instance.new("Sound")
  116. o6 = Instance.new("Sound")
  117. o7 = Instance.new("PointLight")
  118. o8 = Instance.new("Sound")
  119. o10 = Instance.new("LocalScript")
  120. o11 = Instance.new("Animation")
  121. o12 = Instance.new("ScreenGui")
  122. o13 = Instance.new("Frame")
  123. o14 = Instance.new("TextLabel")
  124. o15 = Instance.new("TextLabel")
  125. o16 = Instance.new("TextLabel")
  126. o17 = Instance.new("Frame")
  127. o18 = Instance.new("Frame")
  128. o19 = Instance.new("Frame")
  129. o20 = Instance.new("Frame")
  130. o21 = Instance.new("ImageLabel")
  131. o22 = Instance.new("TextLabel")
  132. o23 = Instance.new("Frame")
  133. o24 = Instance.new("Frame")
  134. o25 = Instance.new("TextLabel")
  135. o26 = Instance.new("LocalScript")
  136. o1.Name = "AUG"
  137. o1.Parent = game.Players.LocalPlayer.Backpack
  138. o1.TextureId = "http://www.roblox.com/asset/?id=122079912"
  139. o1.GripForward = Vector3.new(-0.242535636, -0, -0.970142484)
  140. o1.GripPos = Vector3.new(0.200000003, -0.400000006, 0.200000003)
  141. o1.GripRight = Vector3.new(0.970142484, 0, -0.242535636)
  142. o1.ToolTip = "Steyr AUG"
  143. o1.CanBeDropped = false
  144. o2.Name = "Handle"
  145. o2.Parent = o1
  146. o2.BrickColor = BrickColor.new("Black")
  147. o2.Position = Vector3.new(15.9000006, -8.5, 3.20000005)
  148. o2.FormFactor = Enum.FormFactor.Custom
  149. o2.Size = Vector3.new(0.200000003, 1, 3.5999999)
  150. o2.CFrame = CFrame.new(15.9000006, -8.5, 3.20000005, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  151. o2.BottomSurface = Enum.SurfaceType.Smooth
  152. o2.TopSurface = Enum.SurfaceType.Smooth
  153. o2.Color = Color3.new(0.105882, 0.164706, 0.207843)
  154. o2.Position = Vector3.new(15.9000006, -8.5, 3.20000005)
  155. o3.Parent = o2
  156. o3.MeshId = "http://www.roblox.com/asset/?id=3824738"
  157. o3.Scale = Vector3.new(1.33000004, 1.33000004, 1.33000004)
  158. o3.TextureId = "http://www.roblox.com/asset?ID=3824735 "
  159. o3.MeshType = Enum.MeshType.FileMesh
  160. o4.Name = "FireSound"
  161. o4.Parent = o2
  162. o4.Pitch = 1.3999999761581
  163. o4.SoundId = "http://www.roblox.com/asset/?id=10209859 "
  164. o4.Volume = 1
  165. o5.Name = "Reload"
  166. o5.Parent = o2
  167. o5.SoundId = "http://www.roblox.com/asset/?id=2691591"
  168. o5.Volume = 1
  169. o6.Name = "EquipSound"
  170. o6.Parent = o2
  171. o6.SoundId = "http://www.roblox.com/asset/?id=10209881"
  172. o6.Volume = 1
  173. o7.Name = "Flash"
  174. o7.Parent = o2
  175. o7.Color = Color3.new(1, 1, 0)
  176. o7.Enabled = false
  177. o7.Brightness = 1.5
  178. o8.Name = "Tick"
  179. o8.Parent = o2
  180. o8.SoundId = "rbxasset://sounds//clickfast.wav"
  181. o8.Volume = 1
  182. o10.Name = "AUG"
  183. o10.Parent = o1
  184. print("Giving "..game.Players.LocalPlayer.Name.. " an " ..o1.Name.. " Don't leak this. If you do i will fucking shoot you till your dead ;\ ")
  185. table.insert(cors,coroutine.create(function()
  186. wait()
  187. runDummyScript(function()
  188. --------------------- TEMPLATE ASSAULT RIFLE WEAPON ---------------------------
  189. -- Waits for the child of the specified parent
  190. local function WaitForChild(parent, childName)
  191. while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
  192. return parent[childName]
  193. end
  194.  
  195. ----- MAGIC NUMBERS ABOUT THE TOOL -----
  196. -- How much damage a bullet does
  197. local Damage = 65
  198. -- How many times per second the gun can fire
  199. local FireRate = 1 / 15
  200. -- The maximum distance the can can shoot, this value should never go above 1000
  201. local Range = 700
  202. -- In radians the minimum accuracy penalty
  203. local MinSpread = 0.01
  204. -- In radian the maximum accuracy penalty
  205. local MaxSpread = 0.06
  206. -- Number of bullets in a clip
  207. local ClipSize = 30
  208. -- DefaultValue for spare ammo
  209. local SpareAmmo = math.huge
  210. -- The amount the aim will increase or decrease by
  211. -- decreases this number reduces the speed that recoil takes effect
  212. local AimInaccuracyStepAmount = 0.01
  213. -- Time it takes to reload weapon
  214. local ReloadTime = 2.3
  215. ----------------------------------------
  216.  
  217. -- Colors
  218. local FriendlyReticleColor = Color3.new(0, 1, 0)
  219. local EnemyReticleColor = Color3.new(1, 0, 0)
  220. local NeutralReticleColor = Color3.new(1, 1, 1)
  221.  
  222. local Spread = MinSpread
  223. local AmmoInClip = ClipSize
  224.  
  225. local Tool = o1
  226. local Handle = WaitForChild(Tool, 'Handle')
  227. local WeaponGui = nil
  228.  
  229. local LeftButtonDown
  230. local Reloading = false
  231. local IsShooting = false
  232.  
  233. -- Player specific convenience variables
  234. local MyPlayer = nil
  235. local MyCharacter = nil
  236. local MyHumanoid = nil
  237. local MyTorso = nil
  238. local MyMouse = nil
  239.  
  240. local RecoilAnim
  241. local RecoilTrack = nil
  242.  
  243. local IconURL = Tool.TextureId -- URL to the weapon icon asset
  244.  
  245. local DebrisService = game:GetService('Debris')
  246. local PlayersService = game:GetService('Players')
  247.  
  248.  
  249. local FireSound
  250.  
  251. local OnFireConnection = nil
  252. local OnReloadConnection = nil
  253.  
  254. local DecreasedAimLastShot = false
  255. local LastSpreadUpdate = time()
  256.  
  257. -- this is a dummy object that holds the flash made when the gun is fired
  258. local FlashHolder = nil
  259.  
  260.  
  261. local WorldToCellFunction = Workspace.Terrain.WorldToCellPreferSolid
  262. local GetCellFunction = Workspace.Terrain.GetCell
  263.  
  264. function RayIgnoreCheck(hit, pos)
  265. if hit then
  266. if hit.Transparency >= 1 or string.lower(hit.Name) == "water" or
  267. hit.Name == "Effect" or hit.Name == "Rocket" or hit.Name == "Bullet" or
  268. hit.Name == "Handle" or hit:IsDescendantOf(MyCharacter) then
  269. return true
  270. elseif hit:IsA('Terrain') and pos then
  271. local cellPos = WorldToCellFunction(Workspace.Terrain, pos)
  272. if cellPos then
  273. local cellMat = GetCellFunction(Workspace.Terrain, cellPos.x, cellPos.y, cellPos.z)
  274. if cellMat and cellMat == Enum.CellMaterial.Water then
  275. return true
  276. end
  277. end
  278. end
  279. end
  280. return false
  281. end
  282.  
  283. -- @preconditions: vec should be a unit vector, and 0 < rayLength <= 1000
  284. function RayCast(startPos, vec, rayLength)
  285. local hitObject, hitPos = game.Workspace:FindPartOnRay(Ray.new(startPos + (vec * .01), vec * rayLength), Handle)
  286. if hitObject and hitPos then
  287. local distance = rayLength - (hitPos - startPos).magnitude
  288. if RayIgnoreCheck(hitObject, hitPos) and distance > 0 then
  289. -- there is a chance here for potential infinite recursion
  290. return RayCast(hitPos, vec, distance)
  291. end
  292. end
  293. return hitObject, hitPos
  294. end
  295.  
  296.  
  297.  
  298. function TagHumanoid(humanoid, player)
  299. -- Add more tags here to customize what tags are available.
  300. while humanoid:FindFirstChild('creator') do
  301. humanoid:FindFirstChild('creator'):Destroy()
  302. end
  303. local creatorTag = Instance.new("ObjectValue")
  304. creatorTag.Value = player
  305. creatorTag.Name = "creator"
  306. creatorTag.Parent = humanoid
  307. DebrisService:AddItem(creatorTag, 1.5)
  308.  
  309. local weaponIconTag = Instance.new("StringValue")
  310. weaponIconTag.Value = IconURL
  311. weaponIconTag.Name = "icon"
  312. weaponIconTag.Parent = creatorTag
  313. end
  314.  
  315.  
  316. local function CreateBullet(bulletPos)
  317. local bullet = Instance.new('Part', Workspace)
  318. bullet.FormFactor = Enum.FormFactor.Custom
  319. bullet.Size = Vector3.new(0.1, 0.1, 0.1)
  320. bullet.BrickColor = BrickColor.new("Black")
  321. bullet.Shape = Enum.PartType.Block
  322. bullet.CanCollide = false
  323. bullet.CFrame = CFrame.new(bulletPos)
  324. bullet.Anchored = true
  325. bullet.TopSurface = Enum.SurfaceType.Smooth
  326. bullet.BottomSurface = Enum.SurfaceType.Smooth
  327. bullet.Name = 'Bullet'
  328. DebrisService:AddItem(bullet, 2.5)
  329. return bullet
  330. end
  331.  
  332. local function Reload()
  333. if not Reloading then
  334. Reloading = true
  335. -- Don't reload if you are already full or have no extra ammo
  336. if AmmoInClip ~= ClipSize and SpareAmmo > 0 then
  337. if RecoilTrack then
  338. RecoilTrack:Stop()
  339. end
  340. if WeaponGui and WeaponGui:FindFirstChild('Crosshair') then
  341. if WeaponGui.Crosshair:FindFirstChild('ReloadingLabel') then
  342. WeaponGui.Crosshair.ReloadingLabel.Visible = true
  343. end
  344. end
  345. script.Parent.Handle.Reload:Play()
  346. wait(ReloadTime)
  347. -- Only use as much ammo as you have
  348. local ammoToUse = math.min(ClipSize - AmmoInClip, SpareAmmo)
  349. AmmoInClip = AmmoInClip + ammoToUse
  350. SpareAmmo = SpareAmmo - ammoToUse
  351. UpdateAmmo(AmmoInClip)
  352. WeaponGui.Reload.Visible = false
  353. end
  354. Reloading = false
  355. end
  356. end
  357.  
  358. function OnFire()
  359. if IsShooting then return end
  360. if MyHumanoid and MyHumanoid.Health > 0 then
  361. if RecoilTrack and AmmoInClip > 0 then
  362. RecoilTrack:Play()
  363. end
  364. IsShooting = true
  365. while LeftButtonDown and AmmoInClip > 0 and not Reloading do
  366. if Spread and not DecreasedAimLastShot then
  367. Spread = math.min(MaxSpread, Spread + AimInaccuracyStepAmount)
  368. UpdateCrosshair(Spread)
  369. end
  370. DecreasedAimLastShot = not DecreasedAimLastShot
  371. if Handle:FindFirstChild('FireSound') then
  372. Handle.FireSound:Play()
  373. Handle.Flash.Enabled = true
  374. end
  375. if MyMouse then
  376. local targetPoint = MyMouse.Hit.p
  377. local shootDirection = (targetPoint - Handle.Position).unit
  378. -- Adjust the shoot direction randomly off by a little bit to account for recoil
  379. shootDirection = CFrame.Angles((0.5 - math.random()) * 2 * Spread,
  380. (0.5 - math.random()) * 2 * Spread,
  381. (0.5 - math.random()) * 2 * Spread) * shootDirection
  382. local hitObject, bulletPos = RayCast(Handle.Position, shootDirection, Range)
  383. local bullet
  384. -- Create a bullet here
  385. if hitObject then
  386. bullet = CreateBullet(bulletPos)
  387. end
  388. if hitObject and hitObject.Parent then
  389. local hitHumanoid = hitObject.Parent:FindFirstChild("Humanoid")
  390. if hitHumanoid then
  391. local hitPlayer = game.Players:GetPlayerFromCharacter(hitHumanoid.Parent)
  392. if MyPlayer.Neutral or hitPlayer then
  393. TagHumanoid(hitHumanoid, MyPlayer)
  394. hitHumanoid:TakeDamage(Damage)
  395. if bullet then
  396. bullet:Destroy()
  397. bullet = nil
  398. --bullet.Transparency = 1
  399. end
  400. Spawn(UpdateTargetHit)
  401. end
  402. end
  403. end
  404.  
  405. AmmoInClip = AmmoInClip - 1
  406. UpdateAmmo(AmmoInClip)
  407. end
  408. wait(FireRate)
  409. end
  410. Handle.Flash.Enabled = false
  411. IsShooting = false
  412. if AmmoInClip == 0 then
  413. Handle.Tick:Play()
  414. WeaponGui.Reload.Visible = true
  415. end
  416. if RecoilTrack then
  417. RecoilTrack:Stop()
  418. end
  419. end
  420. end
  421.  
  422. local TargetHits = 0
  423. function UpdateTargetHit()
  424. TargetHits = TargetHits + 1
  425. if WeaponGui and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('TargetHitImage') then
  426. WeaponGui.Crosshair.TargetHitImage.Visible = true
  427. end
  428. wait(0.5)
  429. TargetHits = TargetHits - 1
  430. if TargetHits == 0 and WeaponGui and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('TargetHitImage') then
  431. WeaponGui.Crosshair.TargetHitImage.Visible = false
  432. end
  433. end
  434.  
  435. function UpdateCrosshair(value, mouse)
  436. if WeaponGui then
  437. local absoluteY = 650
  438. WeaponGui.Crosshair:TweenSize(
  439. UDim2.new(0, value * absoluteY * 2 + 23, 0, value * absoluteY * 2 + 23),
  440. Enum.EasingDirection.Out,
  441. Enum.EasingStyle.Linear,
  442. 0.33)
  443. end
  444. end
  445.  
  446. function UpdateAmmo(value)
  447. if WeaponGui and WeaponGui:FindFirstChild('AmmoHud') and WeaponGui.AmmoHud:FindFirstChild('ClipAmmo') then
  448. WeaponGui.AmmoHud.ClipAmmo.Text = AmmoInClip
  449. if value > 0 and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('ReloadingLabel') then
  450. WeaponGui.Crosshair.ReloadingLabel.Visible = false
  451. end
  452. end
  453. if WeaponGui and WeaponGui:FindFirstChild('AmmoHud') and WeaponGui.AmmoHud:FindFirstChild('TotalAmmo') then
  454. WeaponGui.AmmoHud.TotalAmmo.Text = SpareAmmo
  455. end
  456. end
  457.  
  458.  
  459. function OnMouseDown()
  460. LeftButtonDown = true
  461. OnFire()
  462. end
  463.  
  464. function OnMouseUp()
  465. LeftButtonDown = false
  466. end
  467.  
  468. function OnKeyDown(key)
  469. if string.lower(key) == 'r' then
  470. Reload()
  471. end
  472. end
  473.  
  474.  
  475. function OnEquipped(mouse)
  476. Handle.EquipSound:Play()
  477. RecoilAnim = WaitForChild(Tool, 'Recoil')
  478. FireSound = WaitForChild(Handle, 'FireSound')
  479.  
  480. MyCharacter = Tool.Parent
  481. MyPlayer = game:GetService('Players'):GetPlayerFromCharacter(MyCharacter)
  482. MyHumanoid = MyCharacter:FindFirstChild('Humanoid')
  483. MyTorso = MyCharacter:FindFirstChild('Torso')
  484. MyMouse = mouse
  485. WeaponGui = WaitForChild(Tool, 'WeaponHud'):Clone()
  486. if WeaponGui and MyPlayer then
  487. WeaponGui.Parent = MyPlayer.PlayerGui
  488. UpdateAmmo(AmmoInClip)
  489. end
  490. if RecoilAnim then
  491. RecoilTrack = MyHumanoid:LoadAnimation(RecoilAnim)
  492. end
  493.  
  494. if MyMouse then
  495. -- Disable mouse icon
  496. MyMouse.Icon = "http://www.roblox.com/asset/?id=18662154"
  497. MyMouse.Button1Down:connect(OnMouseDown)
  498. MyMouse.Button1Up:connect(OnMouseUp)
  499. MyMouse.KeyDown:connect(OnKeyDown)
  500. end
  501. end
  502.  
  503.  
  504. -- Unequip logic here
  505. function OnUnequipped()
  506. LeftButtonDown = false
  507. Reloading = false
  508. MyCharacter = nil
  509. MyHumanoid = nil
  510. MyTorso = nil
  511. MyPlayer = nil
  512. MyMouse = nil
  513. if OnFireConnection then
  514. OnFireConnection:disconnect()
  515. end
  516. if OnReloadConnection then
  517. OnReloadConnection:disconnect()
  518. end
  519. if FlashHolder then
  520. FlashHolder = nil
  521. end
  522. if WeaponGui then
  523. WeaponGui.Parent = nil
  524. WeaponGui = nil
  525. end
  526. if RecoilTrack then
  527. RecoilTrack:Stop()
  528. end
  529. end
  530.  
  531. local function SetReticleColor(color)
  532. if WeaponGui and WeaponGui:FindFirstChild('Crosshair') then
  533. for _, line in pairs(WeaponGui.Crosshair:GetChildren()) do
  534. if line:IsA('Frame') then
  535. line.BorderColor3 = color
  536. end
  537. end
  538. end
  539. end
  540.  
  541.  
  542. Tool.Equipped:connect(OnEquipped)
  543. Tool.Unequipped:connect(OnUnequipped)
  544.  
  545. while true do
  546. wait(0.033)
  547. if WeaponGui and WeaponGui:FindFirstChild('Crosshair') and MyMouse then
  548. WeaponGui.Crosshair.Position = UDim2.new(0, MyMouse.X, 0, MyMouse.Y)
  549. SetReticleColor(NeutralReticleColor)
  550.  
  551. local target = MyMouse.Target
  552. if target and target.Parent then
  553. local player = PlayersService:GetPlayerFromCharacter(target.Parent)
  554. if player then
  555. if MyPlayer.Neutral or player.TeamColor ~= MyPlayer.TeamColor then
  556. SetReticleColor(EnemyReticleColor)
  557. else
  558. SetReticleColor(FriendlyReticleColor)
  559. end
  560. end
  561. end
  562. end
  563. if Spread and not IsShooting then
  564. local currTime = time()
  565. if currTime - LastSpreadUpdate > FireRate * 2 then
  566. LastSpreadUpdate = currTime
  567. Spread = math.max(MinSpread, Spread - AimInaccuracyStepAmount)
  568. UpdateCrosshair(Spread, MyMouse)
  569. end
  570. end
  571. end
  572.  
  573. end,o10)
  574. end))
  575. o11.Name = "Recoil"
  576. o11.Parent = o1
  577. o11.AnimationId = "http://www.roblox.com/Asset?ID=94331086"
  578. o12.Name = "WeaponHud"
  579. o12.Parent = o1
  580. o13.Name = "AmmoHud"
  581. o13.Parent = o12
  582. o13.Position = UDim2.new(1,-265,1,-60)
  583. o13.Size = UDim2.new(0,200,0,50)
  584. o13.Style = Enum.FrameStyle.RobloxSquare
  585. o13.Position = UDim2.new(1,-265,1,-60)
  586. o13.BackgroundTransparency = 1
  587. o13.BorderSizePixel = 0
  588. o14.Name = "ForwardSlash"
  589. o14.Parent = o13
  590. o14.Position = UDim2.new(0.5,0,0.5,0)
  591. o14.Text = "/"
  592. o14.Position = UDim2.new(0.5,0,0.5,0)
  593. o14.BackgroundTransparency = 1
  594. o14.BorderSizePixel = 0
  595. o14.FontSize = Enum.FontSize.Size24
  596. o14.TextColor3 = Color3.new(1, 1, 1)
  597. o14.TextStrokeTransparency = 0
  598. o15.Name = "ClipAmmo"
  599. o15.Parent = o13
  600. o15.Position = UDim2.new(0.44999998807907,0,0.5,0)
  601. o15.Text = "54"
  602. o15.Position = UDim2.new(0.44999998807907,0,0.5,0)
  603. o15.BackgroundTransparency = 1
  604. o15.BorderSizePixel = 0
  605. o15.FontSize = Enum.FontSize.Size24
  606. o15.TextColor3 = Color3.new(1, 1, 1)
  607. o15.TextStrokeTransparency = 0
  608. o15.TextXAlignment = Enum.TextXAlignment.Right
  609. o16.Name = "TotalAmmo"
  610. o16.Parent = o13
  611. o16.Position = UDim2.new(0.55000001192093,0,0.5,0)
  612. o16.Text = "180"
  613. o16.Position = UDim2.new(0.55000001192093,0,0.5,0)
  614. o16.BackgroundTransparency = 1
  615. o16.BorderSizePixel = 0
  616. o16.FontSize = Enum.FontSize.Size24
  617. o16.TextColor3 = Color3.new(1, 1, 1)
  618. o16.TextStrokeTransparency = 0
  619. o16.TextXAlignment = Enum.TextXAlignment.Left
  620. o17.Name = "Crosshair"
  621. o17.Parent = o12
  622. o17.Position = UDim2.new(0,500,0,500)
  623. o17.Size = UDim2.new(0,150,0,150)
  624. o17.Position = UDim2.new(0,500,0,500)
  625. o17.BackgroundColor3 = Color3.new(0, 1, 0)
  626. o17.BackgroundTransparency = 1
  627. o17.BorderSizePixel = 0
  628. o18.Name = "TopFrame"
  629. o18.Parent = o17
  630. o18.Position = UDim2.new(0,-1,-0.5,-7)
  631. o18.Size = UDim2.new(0,2,0,14)
  632. o18.Position = UDim2.new(0,-1,-0.5,-7)
  633. o18.BackgroundColor3 = Color3.new(1, 1, 1)
  634. o18.BorderColor3 = Color3.new(0, 0, 0)
  635. o19.Name = "RightFrame"
  636. o19.Parent = o17
  637. o19.Position = UDim2.new(0.5,-7,0,-1)
  638. o19.Size = UDim2.new(0,14,0,2)
  639. o19.Position = UDim2.new(0.5,-7,0,-1)
  640. o19.BackgroundColor3 = Color3.new(1, 1, 1)
  641. o19.BorderColor3 = Color3.new(0, 0, 0)
  642. o20.Name = "LeftFrame"
  643. o20.Parent = o17
  644. o20.Position = UDim2.new(-0.5,-7,0,-1)
  645. o20.Size = UDim2.new(0,14,0,2)
  646. o20.Position = UDim2.new(-0.5,-7,0,-1)
  647. o20.BackgroundColor3 = Color3.new(1, 1, 1)
  648. o20.BorderColor3 = Color3.new(0, 0, 0)
  649. o21.Name = "TargetHitImage"
  650. o21.Parent = o17
  651. o21.Position = UDim2.new(0,-25,0,-25)
  652. o21.Size = UDim2.new(0,50,0,50)
  653. o21.Position = UDim2.new(0,-25,0,-25)
  654. o21.Visible = false
  655. o21.BackgroundTransparency = 1
  656. o21.BorderSizePixel = 0
  657. o21.Image = "http://www.roblox.com/asset/?id=115400215"
  658. o22.Name = "ReloadingLabel"
  659. o22.Parent = o17
  660. o22.Position = UDim2.new(0,20,0,-20)
  661. o22.Text = "Reloading"
  662. o22.Position = UDim2.new(0,20,0,-20)
  663. o22.Visible = false
  664. o22.BackgroundTransparency = 1
  665. o22.BorderSizePixel = 0
  666. o22.Font = Enum.Font.ArialBold
  667. o22.FontSize = Enum.FontSize.Size18
  668. o22.TextColor3 = Color3.new(1, 1, 1)
  669. o22.TextStrokeTransparency = 0
  670. o22.TextXAlignment = Enum.TextXAlignment.Left
  671. o22.TextYAlignment = Enum.TextYAlignment.Bottom
  672. o23.Name = "BottomFrame"
  673. o23.Parent = o17
  674. o23.Position = UDim2.new(0,-1,0.5,-7)
  675. o23.Size = UDim2.new(0,2,0,14)
  676. o23.Position = UDim2.new(0,-1,0.5,-7)
  677. o23.BackgroundColor3 = Color3.new(1, 1, 1)
  678. o23.BorderColor3 = Color3.new(0, 0, 0)
  679. o24.Name = "Reload"
  680. o24.Parent = o12
  681. o24.Position = UDim2.new(1,-265,1,-120)
  682. o24.Size = UDim2.new(0,200,0,50)
  683. o24.Position = UDim2.new(1,-265,1,-120)
  684. o24.Visible = false
  685. o24.BackgroundTransparency = 1
  686. o24.BorderSizePixel = 0
  687. o25.Name = "Reload"
  688. o25.Parent = o24
  689. o25.Position = UDim2.new(0.5,0,0.5,0)
  690. o25.Text = "Press R to Reload"
  691. o25.Position = UDim2.new(0.5,0,0.5,0)
  692. o25.BackgroundTransparency = 1
  693. o25.BorderSizePixel = 0
  694. o25.Font = Enum.Font.ArialBold
  695. o25.FontSize = Enum.FontSize.Size24
  696. o25.TextColor3 = Color3.new(1, 0, 0)
  697. o25.TextStrokeTransparency = 0
  698. o26.Name = "ArmWeld [Rifle]"
  699. o26.Parent = o1
  700. table.insert(cors,coroutine.create(function()
  701. wait()
  702. runDummyScript(function()
  703. Tool = script.Parent;
  704.  
  705. local arms = nil
  706. local torso = nil
  707. local welds = {}
  708.  
  709. function Equip(mouse)
  710. wait(0.01)
  711. arms = {Tool.Parent:FindFirstChild("Left Arm"), Tool.Parent:FindFirstChild("Right Arm")}
  712. torso = Tool.Parent:FindFirstChild("Torso")
  713. if arms ~= nil and torso ~= nil then
  714. local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
  715. if sh ~= nil then
  716. local yes = true
  717. if yes then
  718. yes = false
  719. sh[1].Part1 = nil
  720. sh[2].Part1 = nil
  721. local weld1 = Instance.new("Weld")
  722. weld1.Part0 = torso
  723. weld1.Parent = torso
  724. weld1.Part1 = arms[1]
  725. weld1.C1 = CFrame.new(-.1, 1.25, .6) * CFrame.fromEulerAnglesXYZ(math.rad(290), math.rad(10), math.rad(-90)) ---The first set of numbers changes where the arms move to the second set changes their angles
  726. welds[1] = weld1
  727. weld1.Name = "weld1"
  728. local weld2 = Instance.new("Weld")
  729. weld2.Part0 = torso
  730. weld2.Parent = torso
  731. weld2.Part1 = arms[2]
  732. weld2.C1 = CFrame.new(-1, -0.2, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0) --- Same as top
  733. welds[2] = weld2
  734. weld2.Name = "weld2"
  735. end
  736. else
  737. print("sh")
  738. end
  739. else
  740. print("arms")
  741. end
  742. end
  743.  
  744. function Unequip(mouse)
  745. if arms ~= nil and torso ~= nil then
  746. local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
  747. if sh ~= nil then
  748. local yes = true
  749. if yes then
  750. yes = false
  751. sh[1].Part1 = arms[1]
  752. sh[2].Part1 = arms[2]
  753. welds[1].Parent = nil
  754. welds[2].Parent = nil
  755. end
  756. else
  757. print("sh")
  758. end
  759. else
  760. print("arms")
  761. end
  762. end
  763. Tool.Equipped:connect(Equip)
  764. Tool.Unequipped:connect(Unequip)
  765.  
  766. end,o26)
  767. end))
  768. mas.Parent = workspace
  769. mas:MakeJoints()
  770. local mas1 = mas:GetChildren()
  771. for i=1,#mas1 do
  772. mas1[i].Parent = workspace
  773. ypcall(function() mas1[i]:MakeJoints() end)
  774. end
  775. mas:Destroy()
  776. for i=1,#cors do
  777. coroutine.resume(cors[i])
  778. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement