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