Advertisement
Guest User

ODerGui (By boss_kiddos)

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