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