1nubloku

od

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