View difference between Paste ID: 4NdJmRia and cuRRyCXC
SHOW: | | - or go back to the newest paste.
1
if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
2
local Player,game,owner = owner,game
3
local RealPlayer = Player
4
do
5
	print("FE Compatibility code by Mokiros")
6
	local rp = RealPlayer
7
	script.Parent = rp.Character
8
	
9
	--RemoteEvent for communicating
10
	local Event = Instance.new("RemoteEvent")
11
	Event.Name = "UserInput_Event"
12
13
	--Fake event to make stuff like Mouse.KeyDown work
14
	local function fakeEvent()
15
		local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
16
		t.connect = t.Connect
17
		return t
18
	end
19
20
	--Creating fake input objects with fake variables
21
    local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
22
	local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
23
	local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
24
		CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
25
	end}
26
	--Merged 2 functions into one by checking amount of arguments
27
	CAS.UnbindAction = CAS.BindAction
28
29
	--This function will trigger the events that have been :Connect()'ed
30
	local function te(self,ev,...)
31
		local t = m[ev]
32
		if t and t._fakeEvent then
33
			for _,f in pairs(t.Functions) do
34
				f(...)
35
			end
36
		end
37
	end
38
	m.TrigEvent = te
39
	UIS.TrigEvent = te
40
41
	Event.OnServerEvent:Connect(function(plr,io)
42
	    if plr~=rp then return end
43
		m.Target = io.Target
44
		m.Hit = io.Hit
45
		if not io.isMouse then
46
			local b = io.UserInputState == Enum.UserInputState.Begin
47-
            return obj;
47+
			if io.UserInputType == Enum.UserInputType.MouseButton1 then
48
				return m:TrigEvent(b and "Button1Down" or "Button1Up")
49-
    };
49+
50-
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 Mouse = Player:GetMouse()
66
	local UIS = game:GetService("UserInputService")
67
	local input = function(io,a)
68
		if a then return end
69
		--Since InputObject is a client-side instance, we create and pass table instead
70
		Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
71
	end
72
	UIS.InputBegan:Connect(input)
73
	UIS.InputEnded:Connect(input)
74
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
85
	----Sandboxed game object that allows the usage of client-side methods and services
86
	--Real game object
87
	local _rg = game
88
89
	--Metatable for fake service
90
	local fsmt = {
91
		__index = function(self,k)
92
			local s = rawget(self,"_RealService")
93
			if s then return s[k] end
94
		end,
95
		__newindex = function(self,k,v)
96
			local s = rawget(self,"_RealService")
97
			if s then s[k]=v end
98
		end,
99
		__call = function(self,...)
100
			local s = rawget(self,"_RealService")
101
			if s then return s(...) end
102
		end
103
	}
104
	local function FakeService(t,RealService)
105
		t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
106
		return setmetatable(t,fsmt)
107
	end
108
109
	--Fake game object
110
	local g = {
111
		GetService = function(self,s)
112
			return self[s]
113
		end,
114
		Players = FakeService({
115
			LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
116
		},"Players"),
117
		UserInputService = FakeService(UIS,"UserInputService"),
118
		ContextActionService = FakeService(CAS,"ContextActionService"),
119
	}
120
	rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
121
	g.service = g.GetService
122
	
123
	g.RunService = FakeService({
124
		RenderStepped = _rg:GetService("RunService").Heartbeat,
125
		BindToRenderStep = function(self,name,_,fun)
126
			self._btrs[name] = self.Heartbeat:Connect(fun)
127
		end,
128
		UnbindFromRenderStep = function(self,name)
129
			self._btrs[name]:Disconnect()
130
		end,
131
	},"RunService")
132
133
	setmetatable(g,{
134
		__index=function(self,s)
135
			return _rg:GetService(s) or typeof(_rg[s])=="function"
136
			and function(_,...)return _rg[s](_rg,...)end or _rg[s]
137
		end,
138
		__newindex = fsmt.__newindex,
139
		__call = fsmt.__call
140
	})
141
	--Changing owner to fake player object to support owner:GetMouse()
142
	game,owner = g,g.Players.LocalPlayer
143
end
144
function weldBetween(a, b)
145
	--Make a new Weld and Parent it to a.
146
	weld = Instance.new("ManualWeld", a)
147
	--Get the CFrame of b relative to a.
148
	weld.C0 = a.CFrame:inverse() * b.CFrame
149
	--Set the Part0 and Part1 properties respectively
150
	weld.Part0 = a
151
	weld.Part1 = b
152
	--Return the reference to the weld so that you can change it later.
153
	return weld
154
end
155
156
--- THE BELOW WILL FILTER ALL OBJS THAT APPEAR IN WORKSPACE WITH A TEXT PROPERTY
157
do
158
    local filteredMessages = { ['___'] = '___' };
159
    local onPropertyChanged = function (obj)   
160
        if (obj:isDescendantOf (workspace)) then   
161
            local objText = obj.Text;
162
           
163
            if (objText ~= '___' and objText:find '(%S)') then
164
                if (filteredMessages [objText] and filteredMessages [objText] ~= objText) then 
165
                    obj.Text = filteredMessages [objText];
166
                elseif (not filteredMessages [objText]) then
167
                    obj.Text = '___';
168
                   
169
                    local filtered = game:service 'Chat':FilterStringForBroadcast (objText, game:service 'Players'.localPlayer);
170
                   
171
                    filteredMessages [objText] = filtered;
172
                    filteredMessages [filtered] = filtered;
173
                   
174
                    obj.Text = filtered;
175
                end;
176
            end;
177
        end;
178
    end;
179
   
180
    local newInstance = Instance.new;
181
    Instance = {
182
        new = function (class, parent)
183
            local obj = newInstance (class, parent);
184
           
185
            if (pcall (function()return obj.Text;end)) then
186
                obj:getPropertyChangedSignal ('Parent'):connect (function () onPropertyChanged (obj) end);
187
                obj:getPropertyChangedSignal ('Text'):connect (function() onPropertyChanged (obj) end);
188
            
189
           
190
  
191
    
192
--- THE ABOVE
193
194
--Converted with ttyyuu12345's model to script plugin v4
195
function sandbox(var,func)
196
	local env = getfenv(func)
197
	local newenv = setmetatable({},{
198
		__index = function(self,k)
199
			if k=="script" then
200
				return var
201
			else
202
				return env[k]
203
			end
204
		end,
205
	})
206
	setfenv(func,newenv)
207
	return func
208
end
209
cors = {}
210
mas = Instance.new("Model",game:GetService("Lighting"))
211
Model0 = Instance.new("Model")
212
Part1 = Instance.new("Part")
213
SpecialMesh2 = Instance.new("SpecialMesh")
214
Part3 = Instance.new("Part")
215
SpecialMesh4 = Instance.new("SpecialMesh")
216
Part5 = Instance.new("Part")
217
SpecialMesh6 = Instance.new("SpecialMesh")
218
Script7 = Instance.new("Script")
219
Model8 = Instance.new("Model")
220
Part9 = Instance.new("Part")
221
SurfaceGui10 = Instance.new("SurfaceGui")
222
TextLabel11 = Instance.new("TextLabel")
223
Part12 = Instance.new("Part")
224
Part13 = Instance.new("Part")
225
Part14 = Instance.new("Part")
226
Part15 = Instance.new("Part")
227
Part16 = Instance.new("Part")
228
Part17 = Instance.new("Part")
229
Part18 = Instance.new("Part")
230
Part19 = Instance.new("Part")
231
Part20 = Instance.new("Part")
232
Part21 = Instance.new("Part")
233
Part22 = Instance.new("Part")
234
Part23 = Instance.new("Part")
235
Part24 = Instance.new("Part")
236
Part25 = Instance.new("Part")
237
Script26 = Instance.new("Script")
238
Model0.Name = "Helmet"
239
Model0.Parent = mas
240
Model0.PrimaryPart = Part1
241
Part1.Name = "Center"
242
Part1.Parent = Model0
243
Part1.Transparency = 1
244
Part1.Rotation = Vector3.new(0.340000004, -1.46999991, 0.239999995)
245
Part1.CanCollide = false
246
Part1.FormFactor = Enum.FormFactor.Symmetric
247
Part1.Size = Vector3.new(2, 1, 1)
248
Part1.CFrame = CFrame.new(72.9180908, 6.41160107, -177.899567, 0.999660254, -0.0041671074, -0.0257321466, 0.00401700102, 0.999974668, -0.00588235958, 0.0257560052, 0.00577699533, 0.999651611)
249
Part1.TopSurface = Enum.SurfaceType.Smooth
250
Part1.Position = Vector3.new(72.9180908, 6.41160107, -177.899567)
251
Part1.Orientation = Vector3.new(0.340000004, -1.46999991, 0.229999989)
252
SpecialMesh2.Parent = Part1
253
SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25)
254
SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25)
255
Part3.Parent = Model0
256
Part3.Rotation = Vector3.new(4.1500001, -1.28999996, 0.429999977)
257
Part3.CanCollide = false
258
Part3.FormFactor = Enum.FormFactor.Symmetric
259
Part3.Size = Vector3.new(2, 1, 1)
260
Part3.CFrame = CFrame.new(72.9490585, 6.97505713, -177.815628, 0.999717772, -0.00752264773, -0.0225359276, 0.00587299839, 0.997358978, -0.0723927915, 0.0230209939, 0.0722400099, 0.997121572)
261
Part3.BottomSurface = Enum.SurfaceType.Smooth
262
Part3.TopSurface = Enum.SurfaceType.Smooth
263
Part3.Position = Vector3.new(72.9490585, 6.97505713, -177.815628)
264
Part3.Orientation = Vector3.new(4.1500001, -1.28999996, 0.340000004)
265
SpecialMesh4.Parent = Part3
266
SpecialMesh4.MeshId = "http://www.roblox.com/asset/?id=25648271"
267
SpecialMesh4.Scale = Vector3.new(1.29999995, 1.35000002, 1.29999995)
268
SpecialMesh4.TextureId = "http://www.roblox.com/asset/?id=28664001"
269
SpecialMesh4.MeshType = Enum.MeshType.FileMesh
270
SpecialMesh4.Scale = Vector3.new(1.29999995, 1.35000002, 1.29999995)
271
Part5.Parent = Model0
272
Part5.BrickColor = BrickColor.new("Really black")
273
Part5.Rotation = Vector3.new(0.839999974, -1.33999991, 1.26999998)
274
Part5.CanCollide = false
275
Part5.FormFactor = Enum.FormFactor.Plate
276
Part5.Size = Vector3.new(2, 1.20000005, 1)
277
Part5.CFrame = CFrame.new(72.9557266, 6.47859812, -177.850067, 0.999482214, -0.0220845398, -0.0234031118, 0.0217460059, 0.999656618, -0.0146224797, 0.023718005, 0.0141059821, 0.999619246)
278
Part5.BottomSurface = Enum.SurfaceType.Smooth
279
Part5.TopSurface = Enum.SurfaceType.Smooth
280
Part5.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
281
Part5.Position = Vector3.new(72.9557266, 6.47859812, -177.850067)
282
Part5.Orientation = Vector3.new(0.839999974, -1.33999991, 1.25)
283
Part5.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
284
SpecialMesh6.Parent = Part5
285
SpecialMesh6.MeshId = "http://www.roblox.com/asset/?id=1286427"
286
SpecialMesh6.Scale = Vector3.new(1.10000002, 1.10000002, 1.10000002)
287
SpecialMesh6.MeshType = Enum.MeshType.FileMesh
288
SpecialMesh6.Scale = Vector3.new(1.10000002, 1.10000002, 1.10000002)
289
Script7.Name = "qPerfectionWeld"
290
Script7.Parent = Model0
291
table.insert(cors,sandbox(Script7,function()
292
-- Created by Quenty (@Quenty, follow me on twitter).
293
-- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
294
-- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
295
296
--[[ INSTRUCTIONS
297
- Place in the model
298
- Make sure model is anchored
299
- That's it. It will weld the model and all children. 
300
301
THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED. 
302
THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED. 
303
THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED. 
304
THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED. 
305
THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED. 
306
THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED. 
307
THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED. 
308
THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED. 
309
310
This script is designed to be used is a regular script. In a local script it will weld, but it will not attempt to handle ancestory changes. 
311
]]
312
313
--[[ DOCUMENTATION
314
- Will work in tools. If ran more than once it will not create more than one weld.  This is especially useful for tools that are dropped and then picked up again.
315
- Will work in PBS servers
316
- Will work as long as it starts out with the part anchored
317
- Stores the relative CFrame as a CFrame value
318
- Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
319
- Utilizes a recursive algorith to find all parts in the model
320
- Will reweld on script reparent if the script is initially parented to a tool.
321
- Welds as fast as possible
322
]]
323
324
-- qPerfectionWeld.lua
325
-- Created 10/6/2014
326
-- Author: Quenty
327
-- Version 1.0.3
328
329
-- Updated 10/14/2014 - Updated to 1.0.1
330
--- Bug fix with existing ROBLOX welds ? Repro by asimo3089
331
332
-- Updated 10/14/2014 - Updated to 1.0.2
333
--- Fixed bug fix. 
334
335
-- Updated 10/14/2014 - Updated to 1.0.3
336
--- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
337
338
local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
339
340
341
local function CallOnChildren(Instance, FunctionToCall)
342
	-- Calls a function on each of the children of a certain object, using recursion.  
343
344
	FunctionToCall(Instance)
345
346
	for _, Child in next, Instance:GetChildren() do
347
		CallOnChildren(Child, FunctionToCall)
348
	end
349
end
350
351
local function GetNearestParent(Instance, ClassName)
352
	-- Returns the nearest parent of a certain class, or returns nil
353
354
	local Ancestor = Instance
355
	repeat
356
		Ancestor = Ancestor.Parent
357
		if Ancestor == nil then
358
			return nil
359
		end
360
	until Ancestor:IsA(ClassName)
361
362
	return Ancestor
363
end
364
365
local function GetBricks(StartInstance)
366
	local List = {}
367
368
	-- if StartInstance:IsA("BasePart") then
369
	-- 	List[#List+1] = StartInstance
370
	-- end
371
372
	CallOnChildren(StartInstance, function(Item)
373
		if Item:IsA("BasePart") then
374
			List[#List+1] = Item;
375
		end
376
	end)
377
378
	return List
379
end
380
381
local function Modify(Instance, Values)
382
	-- Modifies an Instance by using a table.  
383
384
	assert(type(Values) == "table", "Values is not a table");
385
386
	for Index, Value in next, Values do
387
		if type(Index) == "number" then
388
			Value.Parent = Instance
389
		else
390
			Instance[Index] = Value
391
		end
392
	end
393
	return Instance
394
end
395
396
local function Make(ClassType, Properties)
397
	-- Using a syntax hack to create a nice way to Make new items.  
398
399
	return Modify(Instance.new(ClassType), Properties)
400
end
401
402
local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
403
local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
404
405
local function HasWheelJoint(Part)
406
	for _, SurfaceName in pairs(Surfaces) do
407
		for _, HingSurfaceName in pairs(HingSurfaces) do
408
			if Part[SurfaceName].Name == HingSurfaceName then
409
				return true
410
			end
411
		end
412
	end
413
	
414
	return false
415
end
416
417
local function ShouldBreakJoints(Part)
418
	--- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
419
	--  definitely some edge cases. 
420
421
	if NEVER_BREAK_JOINTS then
422
		return false
423
	end
424
	
425
	if HasWheelJoint(Part) then
426
		return false
427
	end
428
	
429
	local Connected = Part:GetConnectedParts()
430
	
431
	if #Connected == 1 then
432
		return false
433
	end
434
	
435
	for _, Item in pairs(Connected) do
436
		if HasWheelJoint(Item) then
437
			return false
438
		elseif not Item:IsDescendantOf(script.Parent) then
439
			return false
440
		end
441
	end
442
	
443
	return true
444
end
445
446
local function WeldTogether(Part0, Part1, JointType, WeldParent)
447
	--- Weld's 2 parts together
448
	-- @param Part0 The first part
449
	-- @param Part1 The second part (Dependent part most of the time).
450
	-- @param [JointType] The type of joint. Defaults to weld.
451
	-- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
452
	-- @return The weld created.
453
454
	JointType = JointType or "Weld"
455
	local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
456
	
457
	local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
458
	Modify(NewWeld, {
459
		Name = "qCFrameWeldThingy";
460
		Part0  = Part0;
461
		Part1  = Part1;
462
		C0     = CFrame.new();--Part0.CFrame:inverse();
463
		C1     = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
464
		Parent = Part1;
465
	})
466
467
	if not RelativeValue then
468
		RelativeValue = Make("CFrameValue", {
469
			Parent     = Part1;
470
			Name       = "qRelativeCFrameWeldValue";
471
			Archivable = true;
472
			Value      = NewWeld.C1;
473
		})
474
	end
475
476
	return NewWeld
477
end
478
479
local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
480
	-- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
481
	-- @param MainPart The part to weld the model to (can be in the model).
482
	-- @param [JointType] The type of joint. Defaults to weld. 
483
	-- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
484
	
485
	for _, Part in pairs(Parts) do
486
		if ShouldBreakJoints(Part) then
487
			Part:BreakJoints()
488
		end
489
	end
490
	
491
	for _, Part in pairs(Parts) do
492
		if Part ~= MainPart then
493
			WeldTogether(MainPart, Part, JointType, MainPart)
494
		end
495
	end
496
497
	if not DoNotUnanchor then
498
		for _, Part in pairs(Parts) do
499
			Part.Anchored = false
500
		end
501
		MainPart.Anchored = false
502
	end
503
end
504
505
local function PerfectionWeld()	
506
	local Tool = GetNearestParent(script, "Tool")
507
508
	local Parts = GetBricks(script.Parent)
509
	local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
510
511
	if PrimaryPart then
512
		WeldParts(Parts, PrimaryPart, "Weld", false)
513
	else
514
		warn("qWeld - Unable to weld part")
515
	end
516
	
517
	return Tool
518
end
519
520
local Tool = PerfectionWeld()
521
522
523
if Tool and script.ClassName == "Script" then
524
	--- Don't bother with local scripts
525
526
	script.Parent.AncestryChanged:connect(function()
527
		PerfectionWeld()
528
	end)
529
end
530
531
-- Created by Quenty (@Quenty, follow me on twitter).
532
533
end))
534
Model8.Name = "Vest"
535
Model8.Parent = mas
536
Model8.PrimaryPart = Part25
537
Part9.Name = "Sign"
538
Part9.Parent = Model8
539
Part9.Material = Enum.Material.Metal
540
Part9.BrickColor = BrickColor.new("Sand red")
541
Part9.Transparency = 1
542
Part9.Rotation = Vector3.new(-179.269989, 0.939999998, -179.25)
543
Part9.CanCollide = false
544
Part9.FormFactor = Enum.FormFactor.Symmetric
545
Part9.Size = Vector3.new(1.30000019, 0.550000012, 0.200000003)
546
Part9.CFrame = CFrame.new(72.9406586, 5.29043913, -177.003342, -0.999780118, 0.0131011065, 0.0163731799, 0.0133110015, 0.999829769, 0.0127768656, -0.0162030011, 0.0129919993, -0.99978435)
547
Part9.Color = Color3.new(0.584314, 0.47451, 0.466667)
548
Part9.Position = Vector3.new(72.9406586, 5.29043913, -177.003342)
549
Part9.Orientation = Vector3.new(-0.729999959, 179.059998, 0.75999999)
550
Part9.Color = Color3.new(0.584314, 0.47451, 0.466667)
551
SurfaceGui10.Parent = Part9
552
SurfaceGui10.CanvasSize = Vector2.new(200, 100)
553
TextLabel11.Parent = SurfaceGui10
554
TextLabel11.Transparency = 0
555
TextLabel11.Size = UDim2.new(1, 0, 1, 0)
556
TextLabel11.Text = "POLICE"
557
TextLabel11.BackgroundColor3 = Color3.new(1, 1, 1)
558
TextLabel11.BackgroundTransparency = 1
559
TextLabel11.Font = Enum.Font.SourceSansBold
560
TextLabel11.FontSize = Enum.FontSize.Size96
561
TextLabel11.TextColor3 = Color3.new(1, 1, 1)
562
TextLabel11.TextScaled = true
563
TextLabel11.TextStrokeTransparency = 0
564
TextLabel11.TextWrapped = true
565
Part12.Parent = Model8
566
Part12.Material = Enum.Material.Concrete
567
Part12.BrickColor = BrickColor.new("Black")
568
Part12.Rotation = Vector3.new(174.729996, 82.8499985, -173.940002)
569
Part12.CanCollide = false
570
Part12.FormFactor = Enum.FormFactor.Custom
571
Part12.Size = Vector3.new(0.200000003, 0.71999979, 0.449999988)
572
Part12.CFrame = CFrame.new(72.4569855, 4.71349096, -178.388519, -0.123689957, 0.0131369764, 0.992233932, 0.0145219946, 0.999829352, -0.0114272516, -0.99221462, 0.0129957823, -0.123859614)
573
Part12.BottomSurface = Enum.SurfaceType.Smooth
574
Part12.TopSurface = Enum.SurfaceType.Smooth
575
Part12.Color = Color3.new(0.105882, 0.164706, 0.207843)
576
Part12.Position = Vector3.new(72.4569855, 4.71349096, -178.388519)
577
Part12.Orientation = Vector3.new(0.649999976, 97.1199951, 0.829999983)
578
Part12.Color = Color3.new(0.105882, 0.164706, 0.207843)
579
Part13.Parent = Model8
580
Part13.Material = Enum.Material.Concrete
581
Part13.BrickColor = BrickColor.new("Black")
582
Part13.Rotation = Vector3.new(-179.269989, 0.939999998, -179.25)
583
Part13.CanCollide = false
584
Part13.FormFactor = Enum.FormFactor.Custom
585
Part13.Size = Vector3.new(0.290000021, 0.200000003, 1.19999945)
586
Part13.CFrame = CFrame.new(72.3412857, 5.96526623, -177.624023, -0.999779761, 0.0131309442, 0.0163746756, 0.0133409975, 0.999829352, 0.0127853658, -0.0162039958, 0.0130010033, -0.999784231)
587
Part13.BottomSurface = Enum.SurfaceType.Smooth
588
Part13.TopSurface = Enum.SurfaceType.Smooth
589
Part13.Color = Color3.new(0.105882, 0.164706, 0.207843)
590
Part13.Position = Vector3.new(72.3412857, 5.96526623, -177.624023)
591
Part13.Orientation = Vector3.new(-0.729999959, 179.059998, 0.75999999)
592
Part13.Color = Color3.new(0.105882, 0.164706, 0.207843)
593
Part14.Parent = Model8
594
Part14.Material = Enum.Material.Concrete
595
Part14.BrickColor = BrickColor.new("Black")
596
Part14.Rotation = Vector3.new(0.729999959, -0.939999998, -0.75)
597
Part14.CanCollide = false
598
Part14.FormFactor = Enum.FormFactor.Custom
599
Part14.Size = Vector3.new(0.200000003, 1.2099992, 0.370000035)
600
Part14.CFrame = CFrame.new(72.1091156, 4.81766319, -177.202225, 0.999779761, 0.0131310252, -0.0163746085, -0.0133409975, 0.999829352, -0.0127803665, 0.0162039958, 0.0129960049, 0.999784231)
601
Part14.BottomSurface = Enum.SurfaceType.Smooth
602
Part14.TopSurface = Enum.SurfaceType.Smooth
603
Part14.Color = Color3.new(0.105882, 0.164706, 0.207843)
604
Part14.Position = Vector3.new(72.1091156, 4.81766319, -177.202225)
605
Part14.Orientation = Vector3.new(0.729999959, -0.939999998, -0.75999999)
606
Part14.Color = Color3.new(0.105882, 0.164706, 0.207843)
607
Part15.Parent = Model8
608
Part15.Material = Enum.Material.Concrete
609
Part15.BrickColor = BrickColor.new("Black")
610
Part15.Rotation = Vector3.new(0.729999959, -0.939999998, -0.75)
611
Part15.CanCollide = false
612
Part15.FormFactor = Enum.FormFactor.Custom
613
Part15.Size = Vector3.new(0.200000003, 1.2099992, 0.370000035)
614
Part15.CFrame = CFrame.new(73.7588272, 4.80563593, -177.175812, 0.999779761, 0.0131310252, -0.0163746085, -0.0133409975, 0.999829352, -0.0127803665, 0.0162039958, 0.0129960049, 0.999784231)
615
Part15.BottomSurface = Enum.SurfaceType.Smooth
616
Part15.TopSurface = Enum.SurfaceType.Smooth
617
Part15.Color = Color3.new(0.105882, 0.164706, 0.207843)
618
Part15.Position = Vector3.new(73.7588272, 4.80563593, -177.175812)
619
Part15.Orientation = Vector3.new(0.729999959, -0.939999998, -0.75999999)
620
Part15.Color = Color3.new(0.105882, 0.164706, 0.207843)
621
Part16.Parent = Model8
622
Part16.Material = Enum.Material.Concrete
623
Part16.BrickColor = BrickColor.new("Black")
624
Part16.Rotation = Vector3.new(0.729999959, -0.939999998, -0.75)
625
Part16.CanCollide = false
626
Part16.FormFactor = Enum.FormFactor.Custom
627
Part16.Size = Vector3.new(0.389999896, 0.919999599, 1.18999839)
628
Part16.CFrame = CFrame.new(72.0599594, 4.75864077, -177.613922, 0.999779761, 0.0131310252, -0.0163746085, -0.0133409975, 0.999829352, -0.0127803665, 0.0162039958, 0.0129960049, 0.999784231)
629
Part16.BottomSurface = Enum.SurfaceType.Smooth
630
Part16.TopSurface = Enum.SurfaceType.Smooth
631
Part16.Color = Color3.new(0.105882, 0.164706, 0.207843)
632
Part16.Position = Vector3.new(72.0599594, 4.75864077, -177.613922)
633
Part16.Orientation = Vector3.new(0.729999959, -0.939999998, -0.75999999)
634
Part16.Color = Color3.new(0.105882, 0.164706, 0.207843)
635
Part17.Parent = Model8
636
Part17.Material = Enum.Material.Concrete
637
Part17.BrickColor = BrickColor.new("Black")
638
Part17.Rotation = Vector3.new(39.5, 88.7999954, -38.7599983)
639
Part17.CanCollide = false
640
Part17.FormFactor = Enum.FormFactor.Custom
641
Part17.Size = Vector3.new(0.359999925, 1.74999905, 1.47999918)
642
Part17.CFrame = CFrame.new(72.9529877, 5.08878517, -178.135315, 0.0163680073, 0.0131400097, 0.999779761, 0.0127740065, 0.999829352, -0.0133497929, -0.99978447, 0.0129897017, 0.0161973629)
643
Part17.BottomSurface = Enum.SurfaceType.Smooth
644
Part17.TopSurface = Enum.SurfaceType.Smooth
645
Part17.Color = Color3.new(0.105882, 0.164706, 0.207843)
646
Part17.Position = Vector3.new(72.9529877, 5.08878517, -178.135315)
647
Part17.Orientation = Vector3.new(0.75999999, 89.0699997, 0.729999959)
648
Part17.Color = Color3.new(0.105882, 0.164706, 0.207843)
649
Part18.Parent = Model8
650
Part18.Material = Enum.Material.Concrete
651
Part18.BrickColor = BrickColor.new("Black")
652
Part18.Rotation = Vector3.new(39.5, 88.7999954, -38.7599983)
653
Part18.CanCollide = false
654
Part18.FormFactor = Enum.FormFactor.Custom
655
Part18.Size = Vector3.new(0.359999806, 1.7899996, 1.47999918)
656
Part18.CFrame = CFrame.new(72.9363556, 5.08558512, -177.105606, 0.0163680073, 0.0131400097, 0.999779761, 0.0127740065, 0.999829352, -0.0133497929, -0.99978447, 0.0129897017, 0.0161973629)
657
Part18.BottomSurface = Enum.SurfaceType.Smooth
658
Part18.TopSurface = Enum.SurfaceType.Smooth
659
Part18.Color = Color3.new(0.105882, 0.164706, 0.207843)
660
Part18.Position = Vector3.new(72.9363556, 5.08558512, -177.105606)
661
Part18.Orientation = Vector3.new(0.75999999, 89.0699997, 0.729999959)
662
Part18.Color = Color3.new(0.105882, 0.164706, 0.207843)
663
Part19.Parent = Model8
664
Part19.Material = Enum.Material.Concrete
665
Part19.BrickColor = BrickColor.new("Black")
666
Part19.Rotation = Vector3.new(-179.269989, 0.939999998, -179.25)
667
Part19.CanCollide = false
668
Part19.FormFactor = Enum.FormFactor.Custom
669
Part19.Size = Vector3.new(0.290000021, 0.200000003, 1.19999945)
670
Part19.CFrame = CFrame.new(73.5408936, 5.93928385, -177.604767, -0.999779761, 0.0131309442, 0.0163746756, 0.0133409975, 0.999829352, 0.0127853658, -0.0162039958, 0.0130010033, -0.999784231)
671
Part19.BottomSurface = Enum.SurfaceType.Smooth
672
Part19.TopSurface = Enum.SurfaceType.Smooth
673
Part19.Color = Color3.new(0.105882, 0.164706, 0.207843)
674
Part19.Position = Vector3.new(73.5408936, 5.93928385, -177.604767)
675
Part19.Orientation = Vector3.new(-0.729999959, 179.059998, 0.75999999)
676
Part19.Color = Color3.new(0.105882, 0.164706, 0.207843)
677
Part20.Parent = Model8
678
Part20.Material = Enum.Material.Concrete
679
Part20.BrickColor = BrickColor.new("Black")
680
Part20.Rotation = Vector3.new(0.729999959, -0.939999998, -0.75)
681
Part20.CanCollide = false
682
Part20.FormFactor = Enum.FormFactor.Custom
683
Part20.Size = Vector3.new(0.200000003, 1.2099992, 0.370000035)
684
Part20.CFrame = CFrame.new(72.1244736, 4.82962418, -178.142212, 0.999779761, 0.0131310252, -0.0163746085, -0.0133409975, 0.999829352, -0.0127803665, 0.0162039958, 0.0129960049, 0.999784231)
685
Part20.BottomSurface = Enum.SurfaceType.Smooth
686
Part20.TopSurface = Enum.SurfaceType.Smooth
687
Part20.Color = Color3.new(0.105882, 0.164706, 0.207843)
688
Part20.Position = Vector3.new(72.1244736, 4.82962418, -178.142212)
689
Part20.Orientation = Vector3.new(0.729999959, -0.939999998, -0.75999999)
690
Part20.Color = Color3.new(0.105882, 0.164706, 0.207843)
691
Part21.Parent = Model8
692
Part21.Material = Enum.Material.Concrete
693
Part21.BrickColor = BrickColor.new("Black")
694
Part21.Rotation = Vector3.new(0.729999959, -0.939999998, -0.75)
695
Part21.CanCollide = false
696
Part21.FormFactor = Enum.FormFactor.Custom
697
Part21.Size = Vector3.new(0.389999896, 0.919999599, 1.18999839)
698
Part21.CFrame = CFrame.new(73.7796783, 4.74567795, -177.585907, 0.999779761, 0.0131310252, -0.0163746085, -0.0133409975, 0.999829352, -0.0127803665, 0.0162039958, 0.0129960049, 0.999784231)
699
Part21.BottomSurface = Enum.SurfaceType.Smooth
700
Part21.TopSurface = Enum.SurfaceType.Smooth
701
Part21.Color = Color3.new(0.105882, 0.164706, 0.207843)
702
Part21.Position = Vector3.new(73.7796783, 4.74567795, -177.585907)
703
Part21.Orientation = Vector3.new(0.729999959, -0.939999998, -0.75999999)
704
Part21.Color = Color3.new(0.105882, 0.164706, 0.207843)
705
Part22.Parent = Model8
706
Part22.Material = Enum.Material.Concrete
707
Part22.BrickColor = BrickColor.new("Black")
708
Part22.Rotation = Vector3.new(0.729999959, -0.939999998, -0.75)
709
Part22.CanCollide = false
710
Part22.FormFactor = Enum.FormFactor.Custom
711
Part22.Size = Vector3.new(0.200000003, 1.2099992, 0.370000035)
712
Part22.CFrame = CFrame.new(73.7241669, 4.80833578, -178.116241, 0.999779761, 0.0131310252, -0.0163746085, -0.0133409975, 0.999829352, -0.0127803665, 0.0162039958, 0.0129960049, 0.999784231)
713
Part22.BottomSurface = Enum.SurfaceType.Smooth
714
Part22.TopSurface = Enum.SurfaceType.Smooth
715
Part22.Color = Color3.new(0.105882, 0.164706, 0.207843)
716
Part22.Position = Vector3.new(73.7241669, 4.80833578, -178.116241)
717
Part22.Orientation = Vector3.new(0.729999959, -0.939999998, -0.75999999)
718
Part22.Color = Color3.new(0.105882, 0.164706, 0.207843)
719
Part23.Parent = Model8
720
Part23.Material = Enum.Material.Concrete
721
Part23.BrickColor = BrickColor.new("Black")
722
Part23.Rotation = Vector3.new(6.08999968, 81.9700012, -5.4000001)
723
Part23.CanCollide = false
724
Part23.FormFactor = Enum.FormFactor.Custom
725
Part23.Size = Vector3.new(0.200000003, 0.720000088, 0.449999988)
726
Part23.CFrame = CFrame.new(73.4771957, 4.71013212, -178.391571, 0.139059052, 0.0131340493, 0.990197003, 0.0110520059, 0.999829233, -0.0148139065, -0.990222454, 0.0130036715, 0.138890132)
727
Part23.BottomSurface = Enum.SurfaceType.Smooth
728
Part23.TopSurface = Enum.SurfaceType.Smooth
729
Part23.Color = Color3.new(0.105882, 0.164706, 0.207843)
730
Part23.Position = Vector3.new(73.4771957, 4.71013212, -178.391571)
731
Part23.Orientation = Vector3.new(0.849999964, 82.0199966, 0.629999995)
732
Part23.Color = Color3.new(0.105882, 0.164706, 0.207843)
733
Part24.Parent = Model8
734
Part24.Material = Enum.Material.Concrete
735
Part24.BrickColor = BrickColor.new("Black")
736
Part24.Rotation = Vector3.new(39.5, 88.7999954, -38.7599983)
737
Part24.CanCollide = false
738
Part24.FormFactor = Enum.FormFactor.Custom
739
Part24.Size = Vector3.new(0.200000003, 0.729999781, 0.449999988)
740
Part24.CFrame = CFrame.new(72.9676437, 4.71220207, -178.419983, 0.0163680073, 0.0131400097, 0.999779761, 0.0127740065, 0.999829352, -0.0133497929, -0.99978447, 0.0129897017, 0.0161973629)
741
Part24.BottomSurface = Enum.SurfaceType.Smooth
742
Part24.TopSurface = Enum.SurfaceType.Smooth
743
Part24.Color = Color3.new(0.105882, 0.164706, 0.207843)
744
Part24.Position = Vector3.new(72.9676437, 4.71220207, -178.419983)
745
Part24.Orientation = Vector3.new(0.75999999, 89.0699997, 0.729999959)
746
Part24.Color = Color3.new(0.105882, 0.164706, 0.207843)
747
Part25.Name = "Center"
748
Part25.Parent = Model8
749
Part25.Transparency = 1
750
Part25.Rotation = Vector3.new(0.0599999987, -1.02999997, -0.569999993)
751
Part25.CanCollide = false
752
Part25.FormFactor = Enum.FormFactor.Symmetric
753
Part25.Size = Vector3.new(2, 2, 1)
754
Part25.CFrame = CFrame.new(72.9311523, 4.96114111, -177.610779, 0.999788582, 0.00987272803, -0.0180385765, -0.00989200547, 0.999950647, -0.000979764038, 0.0180280115, 0.00115799461, 0.999836862)
755
Part25.Position = Vector3.new(72.9311523, 4.96114111, -177.610779)
756
Part25.Orientation = Vector3.new(0.0599999987, -1.02999997, -0.569999993)
757
Script26.Name = "qPerfectionWeld"
758
Script26.Parent = Model8
759
table.insert(cors,sandbox(Script26,function()
760
-- Created by Quenty (@Quenty, follow me on twitter).
761
-- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
762
-- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
763
764
--[[ INSTRUCTIONS
765
- Place in the model
766
- Make sure model is anchored
767
- That's it. It will weld the model and all children. 
768
769
THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED. 
770
THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED. 
771
THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED. 
772
THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED. 
773
THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED. 
774
THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED. 
775
THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED. 
776
THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED. 
777
778
This script is designed to be used is a regular script. In a local script it will weld, but it will not attempt to handle ancestory changes. 
779
]]
780
781
--[[ DOCUMENTATION
782
- Will work in tools. If ran more than once it will not create more than one weld.  This is especially useful for tools that are dropped and then picked up again.
783
- Will work in PBS servers
784
- Will work as long as it starts out with the part anchored
785
- Stores the relative CFrame as a CFrame value
786
- Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
787
- Utilizes a recursive algorith to find all parts in the model
788
- Will reweld on script reparent if the script is initially parented to a tool.
789
- Welds as fast as possible
790
]]
791
792
-- qPerfectionWeld.lua
793
-- Created 10/6/2014
794
-- Author: Quenty
795
-- Version 1.0.3
796
797
-- Updated 10/14/2014 - Updated to 1.0.1
798
--- Bug fix with existing ROBLOX welds ? Repro by asimo3089
799
800
-- Updated 10/14/2014 - Updated to 1.0.2
801
--- Fixed bug fix. 
802
803
-- Updated 10/14/2014 - Updated to 1.0.3
804
--- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
805
806
local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
807
808
809
local function CallOnChildren(Instance, FunctionToCall)
810
	-- Calls a function on each of the children of a certain object, using recursion.  
811
812
	FunctionToCall(Instance)
813
814
	for _, Child in next, Instance:GetChildren() do
815
		CallOnChildren(Child, FunctionToCall)
816
	end
817
end
818
819
local function GetNearestParent(Instance, ClassName)
820
	-- Returns the nearest parent of a certain class, or returns nil
821
822
	local Ancestor = Instance
823
	repeat
824
		Ancestor = Ancestor.Parent
825
		if Ancestor == nil then
826
			return nil
827
		end
828
	until Ancestor:IsA(ClassName)
829
830
	return Ancestor
831
end
832
833
local function GetBricks(StartInstance)
834
	local List = {}
835
836
	-- if StartInstance:IsA("BasePart") then
837
	-- 	List[#List+1] = StartInstance
838
	-- end
839
840
	CallOnChildren(StartInstance, function(Item)
841
		if Item:IsA("BasePart") then
842
			List[#List+1] = Item;
843
		end
844
	end)
845
846
	return List
847
end
848
849
local function Modify(Instance, Values)
850
	-- Modifies an Instance by using a table.  
851
852
	assert(type(Values) == "table", "Values is not a table");
853
854
	for Index, Value in next, Values do
855
		if type(Index) == "number" then
856
			Value.Parent = Instance
857
		else
858
			Instance[Index] = Value
859
		end
860
	end
861
	return Instance
862
end
863
864
local function Make(ClassType, Properties)
865
	-- Using a syntax hack to create a nice way to Make new items.  
866
867
	return Modify(Instance.new(ClassType), Properties)
868
end
869
870
local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
871
local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
872
873
local function HasWheelJoint(Part)
874
	for _, SurfaceName in pairs(Surfaces) do
875
		for _, HingSurfaceName in pairs(HingSurfaces) do
876
			if Part[SurfaceName].Name == HingSurfaceName then
877
				return true
878
			end
879
		end
880
	end
881
	
882
	return false
883
end
884
885
local function ShouldBreakJoints(Part)
886
	--- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
887
	--  definitely some edge cases. 
888
889
	if NEVER_BREAK_JOINTS then
890
		return false
891
	end
892
	
893
	if HasWheelJoint(Part) then
894
		return false
895
	end
896
	
897
	local Connected = Part:GetConnectedParts()
898
	
899
	if #Connected == 1 then
900
		return false
901
	end
902
	
903
	for _, Item in pairs(Connected) do
904
		if HasWheelJoint(Item) then
905
			return false
906
		elseif not Item:IsDescendantOf(script.Parent) then
907
			return false
908
		end
909
	end
910
	
911
	return true
912
end
913
914
local function WeldTogether(Part0, Part1, JointType, WeldParent)
915
	--- Weld's 2 parts together
916
	-- @param Part0 The first part
917
	-- @param Part1 The second part (Dependent part most of the time).
918
	-- @param [JointType] The type of joint. Defaults to weld.
919
	-- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
920
	-- @return The weld created.
921
922
	JointType = JointType or "Weld"
923
	local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
924
	
925
	local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
926
	Modify(NewWeld, {
927
		Name = "qCFrameWeldThingy";
928
		Part0  = Part0;
929
		Part1  = Part1;
930
		C0     = CFrame.new();--Part0.CFrame:inverse();
931
		C1     = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
932
		Parent = Part1;
933
	})
934
935
	if not RelativeValue then
936
		RelativeValue = Make("CFrameValue", {
937
			Parent     = Part1;
938
			Name       = "qRelativeCFrameWeldValue";
939
			Archivable = true;
940
			Value      = NewWeld.C1;
941
		})
942
	end
943
944
	return NewWeld
945
end
946
947
local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
948
	-- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
949
	-- @param MainPart The part to weld the model to (can be in the model).
950
	-- @param [JointType] The type of joint. Defaults to weld. 
951
	-- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
952
	
953
	for _, Part in pairs(Parts) do
954
		if ShouldBreakJoints(Part) then
955
			Part:BreakJoints()
956
		end
957
	end
958
	
959
	for _, Part in pairs(Parts) do
960
		if Part ~= MainPart then
961
			WeldTogether(MainPart, Part, JointType, MainPart)
962
		end
963
	end
964
965
	if not DoNotUnanchor then
966
		for _, Part in pairs(Parts) do
967
			Part.Anchored = false
968
		end
969
		MainPart.Anchored = false
970
	end
971
end
972
973
local function PerfectionWeld()	
974
	local Tool = GetNearestParent(script, "Tool")
975
976
	local Parts = GetBricks(script.Parent)
977
	local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
978
979
	if PrimaryPart then
980
		WeldParts(Parts, PrimaryPart, "Weld", false)
981
	else
982
		warn("qWeld - Unable to weld part")
983
	end
984
	
985
	return Tool
986
end
987
988
local Tool = PerfectionWeld()
989
990
991
if Tool and script.ClassName == "Script" then
992
	--- Don't bother with local scripts
993
994
	script.Parent.AncestryChanged:connect(function()
995
		PerfectionWeld()
996
	end)
997
end
998
999
-- Created by Quenty (@Quenty, follow me on twitter).
1000
1001
end))
1002
1003
delay(0.3, function()
1004
Part25.CFrame = game:GetService("Players").LocalPlayer.Character.Torso.CFrame
1005
weldBetween(game:GetService("Players").LocalPlayer.Character.Torso, Part25)
1006
1007
Part1.CFrame = game:GetService("Players").LocalPlayer.Character.Head.CFrame
1008
weldBetween(game:GetService("Players").LocalPlayer.Character.Head, Part1)
1009
1010
for i,v in pairs(game:GetService("Players").LocalPlayer.Character:GetChildren()) do
1011
	if v:IsA("Accessory") or v:IsA("Hat") or v:IsA("Shirt") or v:IsA("Pants") or v:IsA("ShirtGraphic") or v:IsA("CharacterMesh") then
1012
		v:Destroy()
1013
	end
1014
end
1015
1016
shirt = Instance.new("Shirt", game:GetService("Players").LocalPlayer.Character)
1017
shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=104018587"
1018
1019
pants = Instance.new("Pants", game:GetService("Players").LocalPlayer.Character)
1020
pants.PantsTemplate = "http://www.roblox.com/asset/?id=104018712"
1021
1022
if game:GetService("Players").LocalPlayer.Character:FindFirstChild("Body Colors") then
1023
	game:GetService("Players").LocalPlayer.Character:FindFirstChild("Body Colors").HeadColor = BrickColor.new("Pastel yellow")
1024
end
1025
end)
1026
1027
for i,v in pairs(mas:GetChildren()) do
1028
	v.Parent = game:GetService("Players").LocalPlayer.Character
1029
	pcall(function() v:MakeJoints() end)
1030
end
1031
mas:Destroy()
1032
for i,v in pairs(cors) do
1033
	spawn(function()
1034
		pcall(v)
1035
	end)
1036
end
1037
1038
--Converted with ttyyuu12345's model to script plugin v4
1039
function sandbox(var,func)
1040
	local env = getfenv(func)
1041
	local newenv = setmetatable({},{
1042
		__index = function(self,k)
1043
			if k=="script" then
1044
				return var
1045
			else
1046
				return env[k]
1047
			end
1048
		end,
1049
	})
1050
	setfenv(func,newenv)
1051
	return func
1052
end
1053
cors = {}
1054
mas = Instance.new("Model",game:GetService("Lighting"))
1055
Tool0 = Instance.new("Tool")
1056
ScreenGui1 = Instance.new("ScreenGui")
1057
Frame2 = Instance.new("Frame")
1058
Frame3 = Instance.new("Frame")
1059
Frame4 = Instance.new("Frame")
1060
Frame5 = Instance.new("Frame")
1061
Frame6 = Instance.new("Frame")
1062
ImageLabel7 = Instance.new("ImageLabel")
1063
TextLabel8 = Instance.new("TextLabel")
1064
Frame9 = Instance.new("Frame")
1065
TextLabel10 = Instance.new("TextLabel")
1066
TextLabel11 = Instance.new("TextLabel")
1067
TextLabel12 = Instance.new("TextLabel")
1068
LocalScript13 = Instance.new("LocalScript")
1069
Animation14 = Instance.new("Animation")
1070
Animation15 = Instance.new("Animation")
1071
Animation16 = Instance.new("Animation")
1072
LocalScript17 = Instance.new("LocalScript")
1073
Part18 = Instance.new("Part")
1074
SpecialMesh19 = Instance.new("SpecialMesh")
1075
Sound20 = Instance.new("Sound")
1076
Fire21 = Instance.new("Fire")
1077
SpotLight22 = Instance.new("SpotLight")
1078
Sound23 = Instance.new("Sound")
1079
Sound24 = Instance.new("Sound")
1080
Tool0.Name = "M16A4"
1081
Tool0.Parent = mas
1082
Tool0.GripForward = Vector3.new(-0.557080328, 0.830272019, 0.0176041722)
1083
Tool0.GripPos = Vector3.new(0.522869527, 0.728810668, -0.409638792)
1084
Tool0.GripRight = Vector3.new(0.830048621, 0.556014359, 0.0432098135)
1085
Tool0.GripUp = Vector3.new(-0.0260877237, -0.0386836678, 0.998910964)
1086
Tool0.CanBeDropped = false
1087
ScreenGui1.Name = "WeaponHud"
1088
ScreenGui1.Parent = Tool0
1089
Frame2.Name = "Crosshair"
1090
Frame2.Parent = ScreenGui1
1091
Frame2.Transparency = 1
1092
Frame2.Size = UDim2.new(0, 150, 0, 150)
1093
Frame2.Position = UDim2.new(0, 500, 0, 500)
1094
Frame2.Visible = false
1095
Frame2.BackgroundColor3 = Color3.new(0, 1, 0)
1096
Frame2.BackgroundTransparency = 1
1097
Frame2.BorderSizePixel = 0
1098
Frame3.Name = "TopFrame"
1099
Frame3.Parent = Frame2
1100
Frame3.Size = UDim2.new(0, 2, 0, 14)
1101
Frame3.Position = UDim2.new(0, -1, -0.5, -7)
1102
Frame3.BackgroundColor3 = Color3.new(0, 0, 0)
1103
Frame3.BorderColor3 = Color3.new(0, 1, 0)
1104
Frame4.Name = "BottomFrame"
1105
Frame4.Parent = Frame2
1106
Frame4.Size = UDim2.new(0, 2, 0, 14)
1107
Frame4.Position = UDim2.new(0, -1, 0.5, -7)
1108
Frame4.BackgroundColor3 = Color3.new(0, 0, 0)
1109
Frame4.BorderColor3 = Color3.new(0, 1, 0)
1110
Frame5.Name = "RightFrame"
1111
Frame5.Parent = Frame2
1112
Frame5.Size = UDim2.new(0, 14, 0, 2)
1113
Frame5.Position = UDim2.new(0.5, -7, 0, -1)
1114
Frame5.BackgroundColor3 = Color3.new(0, 0, 0)
1115
Frame5.BorderColor3 = Color3.new(0, 1, 0)
1116
Frame6.Name = "LeftFrame"
1117
Frame6.Parent = Frame2
1118
Frame6.Size = UDim2.new(0, 14, 0, 2)
1119
Frame6.Position = UDim2.new(-0.5, -7, 0, -1)
1120
Frame6.BackgroundColor3 = Color3.new(0, 0, 0)
1121
Frame6.BorderColor3 = Color3.new(0, 1, 0)
1122
ImageLabel7.Name = "TargetHitImage"
1123
ImageLabel7.Parent = Frame2
1124
ImageLabel7.Transparency = 1
1125
ImageLabel7.Size = UDim2.new(0, 50, 0, 50)
1126
ImageLabel7.Position = UDim2.new(0, -25, 0, -25)
1127
ImageLabel7.Visible = false
1128
ImageLabel7.BackgroundTransparency = 1
1129
ImageLabel7.BorderSizePixel = 0
1130
ImageLabel7.Image = "http://www.roblox.com/asset/?id=69368028"
1131
TextLabel8.Name = "ReloadingLabel"
1132
TextLabel8.Parent = Frame2
1133
TextLabel8.Transparency = 1
1134
TextLabel8.Text = "Reloading"
1135
TextLabel8.Position = UDim2.new(0, 20, 0, -20)
1136
TextLabel8.Visible = false
1137
TextLabel8.BackgroundTransparency = 1
1138
TextLabel8.BorderSizePixel = 0
1139
TextLabel8.Font = Enum.Font.ArialBold
1140
TextLabel8.FontSize = Enum.FontSize.Size18
1141
TextLabel8.TextColor3 = Color3.new(0, 0, 0)
1142
TextLabel8.TextStrokeColor3 = Color3.new(0, 1, 0)
1143
TextLabel8.TextStrokeTransparency = 0
1144
TextLabel8.TextXAlignment = Enum.TextXAlignment.Left
1145
TextLabel8.TextYAlignment = Enum.TextYAlignment.Bottom
1146
Frame9.Name = "AmmoHud"
1147
Frame9.Parent = ScreenGui1
1148
Frame9.Transparency = 1
1149
Frame9.Size = UDim2.new(0, 200, 0, 50)
1150
Frame9.Position = UDim2.new(1, -265, 1, -60)
1151
Frame9.BackgroundTransparency = 1
1152
Frame9.BorderSizePixel = 0
1153
TextLabel10.Name = "ForwardSlash"
1154
TextLabel10.Parent = Frame9
1155
TextLabel10.Transparency = 0
1156
TextLabel10.Text = "/"
1157
TextLabel10.Position = UDim2.new(0.5, 0, 0.5, 0)
1158
TextLabel10.BackgroundTransparency = 1
1159
TextLabel10.BorderSizePixel = 0
1160
TextLabel10.Font = Enum.Font.Arial
1161
TextLabel10.FontSize = Enum.FontSize.Size48
1162
TextLabel10.TextColor3 = Color3.new(1, 1, 1)
1163
TextLabel11.Name = "ClipAmmo"
1164
TextLabel11.Parent = Frame9
1165
TextLabel11.Transparency = 0
1166
TextLabel11.Text = "54"
1167
TextLabel11.Position = UDim2.new(0.449999988, 0, 0.5, 0)
1168
TextLabel11.BackgroundTransparency = 1
1169
TextLabel11.BorderSizePixel = 0
1170
TextLabel11.Font = Enum.Font.Arial
1171
TextLabel11.FontSize = Enum.FontSize.Size48
1172
TextLabel11.TextColor3 = Color3.new(1, 1, 1)
1173
TextLabel11.TextXAlignment = Enum.TextXAlignment.Right
1174
TextLabel12.Name = "TotalAmmo"
1175
TextLabel12.Parent = Frame9
1176
TextLabel12.Transparency = 0
1177
TextLabel12.Text = "180"
1178
TextLabel12.Position = UDim2.new(0.550000012, 0, 0.5, 0)
1179
TextLabel12.BackgroundTransparency = 1
1180
TextLabel12.BorderSizePixel = 0
1181
TextLabel12.Font = Enum.Font.Arial
1182
TextLabel12.FontSize = Enum.FontSize.Size48
1183
TextLabel12.TextColor3 = Color3.new(1, 1, 1)
1184
TextLabel12.TextXAlignment = Enum.TextXAlignment.Left
1185
LocalScript13.Name = "AssaultRifleScript"
1186
LocalScript13.Parent = Tool0
1187
table.insert(cors,sandbox(LocalScript13,function()
1188
--------------------- TEMPLATE ASSAULT RIFLE WEAPON ---------------------------
1189
-- Waits for the child of the specified parent
1190
local function WaitForChild(parent, childName)
1191
	while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
1192
	return parent[childName]
1193
end
1194
1195
----- MAGIC NUMBERS ABOUT THE TOOL -----
1196
-- How much damage a bullet does
1197
local Damage = 27
1198
local HeadMultiplier = 1.65
1199
-- How many times per second the gun can fire
1200
local FireRate = 0.095
1201
-- The maximum distance the can can shoot, this value should never go above 1000
1202
local Range = 400
1203
-- In radians the minimum accuracy penalty
1204
local MinSpread = 0.01
1205
-- In radian the maximum accuracy penalty
1206
local MaxSpread = 0.1
1207
-- Number of bullets in a clip
1208
local ClipSize = 30
1209
-- DefaultValue for spare ammo
1210
local SpareAmmo = 600
1211
-- The amount the aim will increase or decrease by
1212
-- decreases this number reduces the speed that recoil takes effect
1213
local AimInaccuracyStepAmount = 0.0125
1214
-- Time it takes to reload weapon
1215
local ReloadTime = 2.5
1216
----------------------------------------
1217
1218
-- Colors
1219
local FriendlyReticleColor = Color3.new(0, 1, 0)
1220
local EnemyReticleColor	= Color3.new(1, 0, 0)
1221
local NeutralReticleColor	= Color3.new(1, 1, 1)
1222
1223
local Spread = MinSpread
1224
local AmmoInClip = ClipSize
1225
1226
local Tool = script.Parent
1227
local Handle = WaitForChild(Tool, 'Handle')
1228
local WeaponGui = nil
1229
1230
local LeftButtonDown
1231
local Reloading = false
1232
local IsShooting = false
1233
1234
-- Player specific convenience variables
1235
local MyPlayer = nil
1236
local MyCharacter = nil
1237
local MyHumanoid = nil
1238
local MyTorso = nil
1239
local MyMouse = nil
1240
1241
local RecoilAnim
1242
local RecoilTrack = nil
1243
1244
local IconURL = Tool.TextureId  -- URL to the weapon icon asset
1245
1246
local DebrisService = game:GetService('Debris')
1247
local PlayersService = game:GetService('Players')
1248
1249
1250
local FireSound
1251
1252
local OnFireConnection = nil
1253
local OnReloadConnection = nil
1254
1255
local DecreasedAimLastShot = false
1256
local LastSpreadUpdate = time()
1257
1258
-- this is a dummy object that holds the flash made when the gun is fired
1259
local FlashHolder = nil
1260
1261
1262
local WorldToCellFunction = Workspace.Terrain.WorldToCellPreferSolid
1263
local GetCellFunction = Workspace.Terrain.GetCell
1264
1265
function RayIgnoreCheck(hit, pos)
1266
	if hit then
1267
		if hit.Transparency >= 1 or string.lower(hit.Name) == "water" or
1268
				hit.Name == "Effect" or hit.Name == "Rocket" or hit.Name == "Bullet" or
1269
				hit.Name == "Handle" or hit:IsDescendantOf(MyCharacter) then
1270
			return true
1271
		elseif hit:IsA('Terrain') and pos then
1272
			local cellPos = WorldToCellFunction(Workspace.Terrain, pos)
1273
			if cellPos then
1274
				local cellMat = GetCellFunction(Workspace.Terrain, cellPos.x, cellPos.y, cellPos.z)
1275
				if cellMat and cellMat == Enum.CellMaterial.Water then
1276
					return true
1277
				end
1278
			end
1279
		end
1280
	end
1281
	return false
1282
end
1283
1284
-- @preconditions: vec should be a unit vector, and 0 < rayLength <= 1000
1285
function RayCast(startPos, vec, rayLength)
1286
	local hitObject, hitPos = game.Workspace:FindPartOnRay(Ray.new(startPos + (vec * .01), vec * rayLength), Handle)
1287
	if hitObject and hitPos then
1288
		local distance = rayLength - (hitPos - startPos).magnitude
1289
		if RayIgnoreCheck(hitObject, hitPos) and distance > 0 then
1290
			-- there is a chance here for potential infinite recursion
1291
			return RayCast(hitPos, vec, distance)
1292
		end
1293
	end
1294
	return hitObject, hitPos
1295
end
1296
1297
1298
1299
function TagHumanoid(humanoid, player)
1300
	-- Add more tags here to customize what tags are available.
1301
	while humanoid:FindFirstChild('creator') do
1302
		humanoid:FindFirstChild('creator'):Destroy()
1303
	end 
1304
	local creatorTag = Instance.new("ObjectValue")
1305
	creatorTag.Value = player
1306
	creatorTag.Name = "creator"
1307
	creatorTag.Parent = humanoid
1308
	DebrisService:AddItem(creatorTag, 1.5)
1309
1310
	local weaponIconTag = Instance.new("StringValue")
1311
	weaponIconTag.Value = IconURL
1312
	weaponIconTag.Name = "icon"
1313
	weaponIconTag.Parent = creatorTag
1314
end
1315
1316
local function CreateFlash()
1317
	Handle.Light.Enabled = true
1318
	delay(0.01, function()
1319
		Handle.Light.Enabled = false
1320
	end)
1321
	if FlashHolder then
1322
		if not flash then
1323
		flash = Instance.new('Fire', FlashHolder)
1324
		flash.Color = Color3.new(1, 140 / 255, 0)
1325
		flash.SecondaryColor = Color3.new(1, 0, 0)
1326
		flash.Heat = 0
1327
		flash.Size = 0.3
1328
		delay(0.02, function()
1329
			flash.Enabled = false
1330
		end)
1331
		else
1332
			flash.Enabled = true
1333
			delay(0.02, function()
1334
			flash.Enabled = false
1335
		end)
1336
			end
1337
	else
1338
		FlashHolder = Instance.new("Part", Tool)
1339
		FlashHolder.Transparency = 1
1340
		FlashHolder.CanCollide= false
1341
		FlashHolder.Size = Vector3.new(1, 1, 1)
1342
		FlashHolder.Position = Tool.Handle.Position
1343
		local Weld = Instance.new("ManualWeld")
1344
		Weld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
1345
		Weld.C1 = CFrame.new(0, 2.2, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0)
1346
		Weld.Part0 = FlashHolder
1347
		Weld.Part1 = Tool.Handle
1348
		Weld.Parent = FlashHolder
1349
	end
1350
end
1351
1352
local function CreateBullet(bulletPos)
1353
	local bullet = Instance.new('Part', Workspace)
1354
	bullet.FormFactor = Enum.FormFactor.Custom
1355
	bullet.Size = Vector3.new(0.2, 0.2, 0.2)
1356
	bullet.BrickColor = BrickColor.new("Really black")
1357
	bullet.Material = "Neon"
1358
	bullet.Shape = Enum.PartType.Ball
1359
	bullet.CanCollide = false
1360
	bullet.CFrame = CFrame.new(bulletPos)
1361
	bullet.Anchored = true
1362
	bullet.TopSurface = Enum.SurfaceType.Smooth
1363
	bullet.BottomSurface = Enum.SurfaceType.Smooth
1364
	bullet.Name = 'Bullet'
1365
	DebrisService:AddItem(bullet, 2.5)
1366
	--[[local fire = Instance.new("Fire", bullet)
1367
	fire.Color = Color3.new(MyPlayer.TeamColor.r, MyPlayer.TeamColor.g, MyPlayer.TeamColor.b)
1368
	fire.SecondaryColor = Color3.new(MyPlayer.TeamColor.r, MyPlayer.TeamColor.g, MyPlayer.TeamColor.b)
1369
	fire.Size = 1
1370
	fire.Heat = 0
1371
	DebrisService:AddItem(fire, 0.1)]]--
1372
	return bullet
1373
end
1374
1375
local function weldBetween(a, b)
1376
    local weld = Instance.new("Weld")
1377
    weld.Part0 = a
1378
    weld.Part1 = b
1379
    weld.C0 = CFrame.new()
1380
    weld.C1 = b.CFrame:inverse() * a.CFrame
1381
    weld.Parent = a
1382
    return weld;
1383
end
1384
1385
local function Reload()
1386
	if not Reloading then
1387
		Reloading = true
1388
		-- Don't reload if you are already full or have no extra ammo
1389
		if AmmoInClip ~= ClipSize and SpareAmmo > 0 then
1390
			if RecoilTrack then
1391
				RecoilTrack:Stop()
1392
			end
1393
			if WeaponGui and WeaponGui:FindFirstChild('Crosshair') then
1394
				if WeaponGui.Crosshair:FindFirstChild('ReloadingLabel') then
1395
					WeaponGui.Crosshair.ReloadingLabel.Visible = true
1396
				end
1397
			end
1398
			
1399
			local aniTrack = WaitForChild(Tool.Parent,"Humanoid"):LoadAnimation(Tool.Reload)
1400
	local torso=WaitForChild(Tool.Parent,'Left Arm')
1401
	local oldWeld
1402
	for _,i in pairs(WaitForChild(Tool.Parent,'Right Arm'):GetChildren()) do
1403
		if i:IsA('Weld') and i.Part1==Tool.Handle then
1404
			oldWeld=i
1405
		end
1406
	end
1407
	if not oldWeld then 
1408
		print('What... no old weld!')
1409
		return
1410
	end
1411
	
1412
	Handle.Reload:Play()	
1413
	
1414
	aniTrack:Play(0,1,2)
1415
	delay(0.35, function()
1416
		oldWeld.Part1=nil
1417
		ChestWeld= weldBetween(torso,Tool.Handle)
1418
	end)
1419
	wait(ReloadTime)
1420
	oldWeld.Part1=Tool.Handle
1421
	ChestWeld:Destroy()
1422
	ChestWeld=nil
1423
			-- Only use as much ammo as you have
1424
			local ammoToUse = math.min(ClipSize - AmmoInClip, SpareAmmo)
1425
			AmmoInClip = AmmoInClip + ammoToUse
1426
			SpareAmmo = SpareAmmo - ammoToUse
1427
			UpdateAmmo(AmmoInClip)
1428
		end
1429
		Reloading = false
1430
	end
1431
end
1432
1433
function OnFire()
1434
	if IsShooting or stance == true then return end
1435
	if MyHumanoid and MyHumanoid.Health > 0 then
1436
		IsShooting = true
1437
		while LeftButtonDown and AmmoInClip > 0 and not Reloading and MyHumanoid and MyHumanoid.Health > 0 and stance == false do
1438
			RecoilTrack:Play()
1439
			if Spread and not DecreasedAimLastShot then
1440
				Spread = math.min(MaxSpread, Spread + AimInaccuracyStepAmount)
1441
				UpdateCrosshair(Spread)
1442
			end
1443
			DecreasedAimLastShot = not DecreasedAimLastShot
1444
			if Handle:FindFirstChild('FireSound') then
1445
				Handle.FireSound:Play()
1446
			end
1447
			CreateFlash()
1448
			if MyMouse then
1449
				local targetPoint = MyMouse.Hit.p
1450
				local shootDirection = (targetPoint - Handle.Position).unit
1451
				-- Adjust the shoot direction randomly off by a little bit to account for recoil
1452
				shootDirection = CFrame.Angles((0.5 - math.random()) * 2 * Spread,
1453
																(0.5 - math.random()) * 2 * Spread,
1454
																(0.5 - math.random()) * 2 * Spread) * shootDirection
1455
				local hitObject, bulletPos = RayCast(Handle.Position, shootDirection, Range)
1456
				local bullet
1457
				-- Create a bullet here
1458
				if hitObject then
1459
					bullet = CreateBullet(bulletPos)
1460
				end
1461
				if hitObject and hitObject.Parent then
1462
					local hitHumanoid = hitObject.Parent:FindFirstChild("Humanoid")
1463
					if hitHumanoid then
1464
						local hitPlayer = game.Players:GetPlayerFromCharacter(hitHumanoid.Parent)
1465
							TagHumanoid(hitHumanoid, MyPlayer)
1466
							if hitObject.Name == "Head" then
1467
								hitHumanoid:TakeDamage(Damage * HeadMultiplier)
1468
							else
1469
							hitHumanoid:TakeDamage(Damage)
1470
							end
1471
							if bullet then
1472
								bullet:Destroy()
1473
								bullet = nil
1474
								--bullet.Transparency = 1
1475
							end
1476
							Spawn(UpdateTargetHit)
1477
					end
1478
				end
1479
	
1480
				AmmoInClip = AmmoInClip - 1
1481
				UpdateAmmo(AmmoInClip)
1482
			end
1483
			wait(FireRate)
1484
		end		
1485
		IsShooting = false
1486
		if AmmoInClip == 0 then
1487
			Handle.Empty:Play()
1488
		end
1489
		if RecoilTrack then
1490
			RecoilTrack:Stop()
1491
		end
1492
	end
1493
end
1494
1495
local TargetHits = 0
1496
function UpdateTargetHit()
1497
	TargetHits = TargetHits + 1
1498
	if WeaponGui and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('TargetHitImage') then
1499
		WeaponGui.Crosshair.TargetHitImage.Visible = true
1500
	end
1501
	wait(0.5)
1502
	TargetHits = TargetHits - 1
1503
	if TargetHits == 0 and WeaponGui and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('TargetHitImage') then
1504
		WeaponGui.Crosshair.TargetHitImage.Visible = false
1505
	end
1506
end
1507
1508
function UpdateCrosshair(value, mouse)
1509
	if WeaponGui then
1510
		local absoluteY = 650
1511
		WeaponGui.Crosshair:TweenSize(
1512
			UDim2.new(0, value * absoluteY * 2 + 23, 0, value * absoluteY * 2 + 23),
1513
			Enum.EasingDirection.Out,
1514
			Enum.EasingStyle.Linear,
1515
			0.33)
1516
	end
1517
end
1518
1519
function UpdateAmmo(value)
1520
	if WeaponGui and WeaponGui:FindFirstChild('AmmoHud') and WeaponGui.AmmoHud:FindFirstChild('ClipAmmo') then
1521
		WeaponGui.AmmoHud.ClipAmmo.Text = AmmoInClip
1522
		if value > 0 and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('ReloadingLabel') then
1523
			WeaponGui.Crosshair.ReloadingLabel.Visible = false
1524
		end
1525
	end
1526
	if WeaponGui and WeaponGui:FindFirstChild('AmmoHud') and WeaponGui.AmmoHud:FindFirstChild('TotalAmmo') then
1527
		WeaponGui.AmmoHud.TotalAmmo.Text = SpareAmmo
1528
	end
1529
end
1530
1531
1532
function OnMouseDown()
1533
	LeftButtonDown = true
1534
	OnFire()
1535
end
1536
1537
function OnMouseUp()
1538
	LeftButtonDown = false
1539
end
1540
1541
function safety()
1542
	if stance == false then
1543
		stance = true
1544
		Tool.Enabled = false
1545
		passive:Play()
1546
	else
1547
		stance = false
1548
		Tool.Enabled = true
1549
		if passive then
1550
			passive:Stop()
1551
		end
1552
		end
1553
end
1554
1555
function OnKeyDown(key)
1556
	if string.lower(key) == 'r' then
1557
		Reload()
1558
	end
1559
	if string.lower(key) == 'q' then
1560
		safety()
1561
	end
1562
end
1563
1564
1565
function OnEquipped(mouse)
1566
	RecoilAnim = WaitForChild(Tool, 'FireAni')
1567
	FireSound  = WaitForChild(Handle, 'FireSound')
1568
1569
	MyCharacter = Tool.Parent
1570
	MyPlayer = game:GetService('Players'):GetPlayerFromCharacter(MyCharacter)
1571
	MyHumanoid = MyCharacter:FindFirstChild('Humanoid')
1572
	MyTorso = MyCharacter:FindFirstChild('Torso')
1573
	MyMouse = mouse
1574
	WeaponGui = WaitForChild(Tool, 'WeaponHud'):Clone()
1575
	if WeaponGui and MyPlayer then
1576
		WeaponGui.Parent = MyPlayer.PlayerGui
1577
		UpdateAmmo(AmmoInClip)
1578
	end
1579
	if RecoilAnim then
1580
		RecoilTrack = MyHumanoid:LoadAnimation(RecoilAnim)
1581
	end
1582
	idle = MyHumanoid:LoadAnimation(Tool.idle)
1583
	idle:Play()
1584
	gunidleanim = Instance.new("Animation")
1585
	gunidleanim.AnimationId = "http://www.roblox.com/asset/?id=168086975"
1586
	passive = MyHumanoid:LoadAnimation(gunidleanim)
1587
	
1588
	stance = false
1589
	Tool.Enabled = true
1590
	
1591
	if MyMouse then
1592
		-- Disable mouse icon
1593
		MyMouse.Icon = "http://www.roblox.com/asset/?id=2966012"
1594
		MyMouse.Button1Down:connect(OnMouseDown)
1595
		MyMouse.Button1Up:connect(OnMouseUp)
1596
		MyMouse.KeyDown:connect(OnKeyDown)
1597
	end
1598
end
1599
1600
1601
-- Unequip logic here
1602
function OnUnequipped()
1603
	if idle then
1604
		idle:Stop()
1605
	end
1606
	if passive then
1607
		passive:Stop()
1608
	end
1609
	LeftButtonDown = false
1610
	Reloading = false
1611
	MyCharacter = nil
1612
	MyHumanoid = nil
1613
	MyTorso = nil
1614
	MyPlayer = nil
1615
	MyMouse = nil
1616
	if OnFireConnection then
1617
		OnFireConnection:disconnect()
1618
	end
1619
	if OnReloadConnection then
1620
		OnReloadConnection:disconnect()
1621
	end
1622
	if FlashHolder then
1623
		FlashHolder = nil
1624
	end
1625
	if WeaponGui then
1626
		WeaponGui.Parent = nil
1627
		WeaponGui = nil
1628
	end
1629
	if RecoilTrack then
1630
		RecoilTrack:Stop()
1631
	end
1632
end
1633
1634
local function SetReticleColor(color)
1635
	if WeaponGui and WeaponGui:FindFirstChild('Crosshair') then
1636
		for _, line in pairs(WeaponGui.Crosshair:GetChildren()) do
1637
			if line:IsA('Frame') then
1638
				line.BorderColor3 = color
1639
			end
1640
		end
1641
	end
1642
end
1643
1644
1645
Tool.Equipped:connect(OnEquipped)
1646
Tool.Unequipped:connect(OnUnequipped)
1647
1648
while true do
1649
	wait(0.033)
1650
	if WeaponGui and WeaponGui:FindFirstChild('Crosshair') and MyMouse then
1651
		WeaponGui.Crosshair.Position = UDim2.new(0, MyMouse.X, 0, MyMouse.Y)
1652
		SetReticleColor(NeutralReticleColor)
1653
1654
		local target = MyMouse.Target
1655
		if target and target.Parent then
1656
			local player = PlayersService:GetPlayerFromCharacter(target.Parent)
1657
			if player then
1658
				if MyPlayer.Neutral or player.TeamColor ~= MyPlayer.TeamColor then
1659
					SetReticleColor(EnemyReticleColor)
1660
				else
1661
					SetReticleColor(FriendlyReticleColor)
1662
				end
1663
			end
1664
		end
1665
	end
1666
	if Spread and not IsShooting then
1667
		local currTime = time()
1668
		if currTime - LastSpreadUpdate > FireRate * 2 then
1669
			LastSpreadUpdate = currTime
1670
			Spread = math.max(MinSpread, Spread - AimInaccuracyStepAmount)
1671
			UpdateCrosshair(Spread, MyMouse)
1672
		end
1673
	end
1674
end
1675
1676
end))
1677
Animation14.Name = "FireAni"
1678
Animation14.Parent = Tool0
1679
Animation14.AnimationId = "rbxassetid://95390146"
1680
Animation15.Name = "Reload"
1681
Animation15.Parent = Tool0
1682
Animation15.AnimationId = "http://www.roblox.com/Asset?ID=95384819"
1683
Animation16.Name = "idle"
1684
Animation16.Parent = Tool0
1685
Animation16.AnimationId = "rbxassetid://95389685"
1686
LocalScript17.Name = "CameraMoveDev"
1687
LocalScript17.Parent = Tool0
1688
table.insert(cors,sandbox(LocalScript17,function()
1689
wait()
1690
local RunService = game:GetService('RunService')
1691
local player = game.Players.LocalPlayer
1692
local mouse = player:GetMouse()
1693
repeat wait() until player.Character
1694
repeat wait() until player.Character:FindFirstChild("Humanoid")
1695
repeat wait() until player.Character:FindFirstChild("Torso")
1696
local character = player.Character
1697
local humanoid = character:WaitForChild("Humanoid")
1698
torso = character.Torso
1699
keyhold = false
1700
--player.CameraMinZoomDistance = 0.5
1701
lighting = true
1702
haslight = false
1703
1704
mouse.KeyDown:connect(function(key)
1705
	if key == "f" then
1706
		game:GetService("Chat"):Chat(player.Character.Head, "FBI OPEN UP", Enum.ChatColor.Red)
1707
		snd = Instance.new("Sound", player.Character.Head)
1708
		snd.SoundId = "http://www.roblox.com/asset/?id=1545981804"
1709
		snd.EmitterSize = 50
1710
		snd.Volume = 10
1711
		snd:Play()
1712
		delay(0.75, function()
1713
			game.Debris:AddItem(snd, snd.TimeLength)
1714
		end)
1715
	end
1716
end)
1717
1718
mouse.TargetFilter = nil
1719
1720
--humanoid.JumpPower = 0
1721
1722
maxcount = 100
1723
runcount = maxcount
1724
1725
function populateparts(mdl)
1726
	if mdl:IsA("BasePart") then
1727
		table.insert(parts,mdl)
1728
	end
1729
	for i2,mdl2 in ipairs(mdl:GetChildren()) do
1730
		populateparts(mdl2)
1731
	end
1732
end
1733
1734
function weldBetween(a, b)
1735
	--Make a new Weld and Parent it to a.
1736
	weld = Instance.new("ManualWeld", a)
1737
	--Get the CFrame of b relative to a.
1738
	weld.C0 = a.CFrame:inverse() * b.CFrame
1739
	--Set the Part0 and Part1 properties respectively
1740
	weld.Part0 = a
1741
	weld.Part1 = b
1742
	--Return the reference to the weld so that you can change it later.
1743
	return weld
1744
end
1745
1746
humanoid.Died:connect(function()
1747
	if armgroup then
1748
		armgroup:Destroy()
1749
		if cl then
1750
			cl:Destroy()
1751
		end
1752
		if cl2 then
1753
			cl2:Destroy()
1754
		end
1755
	end
1756
end)
1757
1758
LocalObjects = {}
1759
function SetLocalTransparency(Table)
1760
	for i, v in pairs(LocalObjects) do
1761
		if v.Object == Table.Object then
1762
			Table.Object.LocalTransparencyModifier = Table.OriginalTransparency
1763
			table.remove(LocalObjects, i)
1764
		end
1765
	end
1766
	if not Table.Transparency then
1767
		return
1768
	end
1769
	Table.OriginalTransparency = Table.Object.LocalTransparencyModifier
1770
	table.insert(LocalObjects, Table)
1771
	if ModifyTransparency then
1772
		ModifyTransparency:disconnect()
1773
	end
1774
	ModifyTransparency = RunService.RenderStepped:connect(function()
1775
		for i, v in pairs(LocalObjects) do
1776
			if v.Object and v.Object.Parent then
1777
				local CurrentTransparency = v.Object.LocalTransparencyModifier
1778
				if ((not v.AutoUpdate and (CurrentTransparency == 1 or CurrentTransparency == 0)) or v.AutoUpdate) then
1779
					v.Object.LocalTransparencyModifier = v.Transparency
1780
				end
1781
			else
1782
				table.remove(LocalObjects, i)
1783
			end
1784
		end
1785
	end)
1786
end
1787
1788
local function SetupJoints()
1789
	if character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
1790
		return -- TODO: Make tracking compatible with R15
1791
	end
1792
	torso = character:FindFirstChild("Torso")
1793
	
1794
	Neck = torso.Neck
1795
	OldNeckC0 = Neck.C0
1796
	OldNeckC1 = Neck.C1
1797
	Shoulder = torso['Right Shoulder']
1798
	Shoulder2 = torso['Left Shoulder']
1799
	OldShoulderC0 = Shoulder.C0
1800
	OldShoulderC1 = Shoulder.C1
1801
	OldShoulder2C0 = Shoulder2.C0
1802
	OldShoulder2C1 = Shoulder2.C1
1803
end
1804
1805
local function visual()
1806
	if Tool then
1807
	if Tool:FindFirstChild("GetKill") and not game.Workspace.CurrentCamera:FindFirstChild("KillColor") then
1808
		Color = Instance.new("ColorCorrectionEffect")
1809
		Color.Name = "KillColor"
1810
		Color.Saturation = -0.5
1811
		Color.Parent = game.Workspace.CurrentCamera
1812
		game.Debris:AddItem(Color, 0.22)
1813
		Blur = Instance.new("BlurEffect")
1814
		Blur.Name = "KillBlur"
1815
		Blur.Size = 8
1816
		Blur.Parent = game.Workspace.CurrentCamera
1817
		game.Debris:AddItem(Blur, 0.22)
1818
		Tool.GetKill:Destroy()
1819
	end
1820
	
1821
	if Tool:FindFirstChild("GetHeadKill") and not game.Workspace.CurrentCamera:FindFirstChild("KillColor") then
1822
		Color = Instance.new("ColorCorrectionEffect")
1823
		Color.Name = "KillColor"
1824
		Color.Saturation = -0.75
1825
		Color.TintColor = Color3.new(1, 0.9, 0.9)
1826
		Color.Parent = game.Workspace.CurrentCamera
1827
		game.Debris:AddItem(Color, 0.22)
1828
		Blur = Instance.new("BlurEffect")
1829
		Blur.Name = "KillBlur"
1830
		Blur.Size = 8
1831
		Blur.Parent = game.Workspace.CurrentCamera
1832
		game.Debris:AddItem(Blur, 0.22)
1833
		Tool.GetHeadKill:Destroy()
1834
	end
1835
	end
1836
	
1837
	--player.CameraMode = Enum.CameraMode.LockFirstPerson
1838
	
1839
end
1840
1841
SetupJoints()
1842
1843
game:GetService("RunService").RenderStepped:connect(function()
1844
	if character and humanoid.Health > 0 and script.Parent.Parent == character then
1845
	if character:FindFirstChildOfClass("Tool") and character:FindFirstChildOfClass("Tool") == script.Parent then
1846
		Tool = character:FindFirstChildOfClass("Tool")
1847
		visual()
1848
	else
1849
		Tool = nil
1850
		end
1851
		if Tool and Tool.Enabled == true then
1852
		character.Humanoid.AutoRotate = false
1853
		
1854
			mouse.TargetFilter = game.Workspace
1855
			--if (game.Workspace.CurrentCamera.CoordinateFrame.p - game.Workspace.CurrentCamera.Focus.p).magnitude < 1 then
1856
			--game.Workspace.CurrentCamera.CameraSubject = character.Head
1857
			game.Workspace.CurrentCamera.Focus = character.Head.CFrame
1858
			--end
1859
		
1860
			character['Torso'].Neck.C0 = OldNeckC0
1861
		character['Torso'].Neck.C1 = OldNeckC1
1862
		character['Torso']['Right Shoulder'].C0 = OldShoulderC0
1863
		character['Torso']['Right Shoulder'].C1 = OldShoulderC1
1864
		character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
1865
		character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
1866
		
1867
			local toMouse = (mouse.Hit.p - character.Head.Position).unit
1868
			local angle = math.acos(toMouse:Dot(Vector3.new(0,1,0)))
1869
			local neckAngle = angle
1870
			if math.deg(neckAngle) > 110 then
1871
		neckAngle = math.rad(110)
1872
			end
1873
			
1874
			Neck.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.pi - neckAngle,math.pi,0)
1875
			
1876
			character.Torso["Right Shoulder"].C0 = CFrame.new(1,0.5,0) * CFrame.Angles(math.pi/2 - angle,math.pi/2,0)	
1877
	character.Torso["Left Shoulder"].C0 = CFrame.new(-1,0.5,0) * CFrame.Angles(math.pi/2 - angle,math.pi/-2,0)	
1878
	
1879
	if character.Humanoid:GetState() ~= Enum.HumanoidStateType.Seated then
1880
		character['Torso'].CFrame = CFrame.new(character['Torso'].Position, character['Torso'].Position + (Vector3.new(
1881
			mouse.Hit.x, character['Torso'].Position.Y, mouse.Hit.z)-character['Torso'].Position).unit)
1882
	end	
1883
		else
1884
	if armgroup then
1885
				armgroup:Destroy()
1886
				armgroup = nil
1887
			end
1888
	if character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
1889
		character['Torso'].Neck.C0 = OldNeckC0
1890
		character['Torso'].Neck.C1 = OldNeckC1
1891
		character['Torso']['Right Shoulder'].C0 = OldShoulderC0
1892
		character['Torso']['Right Shoulder'].C1 = OldShoulderC1
1893
		character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
1894
		character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
1895
		
1896
		character.Humanoid.AutoRotate = true
1897
		mouse.TargetFilter = nil
1898
		
1899
		game.Workspace.CurrentCamera.CameraSubject = character.Humanoid
1900
	for i, v in pairs(character:GetChildren()) do
1901
		if v:IsA("BasePart") then
1902
			SetLocalTransparency({Object = v, Transparency = nil, AutoUpdate = true})
1903
		end
1904
		if v:IsA("Accessory") then
1905
			SetLocalTransparency({Object = v.Handle, Transparency = nil, AutoUpdate = true})
1906
		end
1907
	end
1908
	end
1909
			end
1910
	end
1911
end)
1912
1913
script.Parent.Unequipped:connect(function()
1914
	if armgroup then
1915
				armgroup:Destroy()
1916
				armgroup = nil
1917
			end
1918
	if character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
1919
		character['Torso'].Neck.C0 = OldNeckC0
1920
		character['Torso'].Neck.C1 = OldNeckC1
1921
		character['Torso']['Right Shoulder'].C0 = OldShoulderC0
1922
		character['Torso']['Right Shoulder'].C1 = OldShoulderC1
1923
		character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
1924
		character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
1925
		
1926
		character.Humanoid.AutoRotate = true
1927
		mouse.TargetFilter = nil
1928
		
1929
		game.Workspace.CurrentCamera.CameraSubject = character.Humanoid
1930
	for i, v in pairs(character:GetChildren()) do
1931
		if v:IsA("BasePart") then
1932
			SetLocalTransparency({Object = v, Transparency = nil, AutoUpdate = true})
1933
		end
1934
		if v:IsA("Accessory") then
1935
			SetLocalTransparency({Object = v.Handle, Transparency = nil, AutoUpdate = true})
1936
		end
1937
	end
1938
	end
1939
end)
1940
end))
1941
Part18.Name = "Handle"
1942
Part18.Parent = Tool0
1943
Part18.BrickColor = BrickColor.new("Black")
1944
Part18.Rotation = Vector3.new(-90, 0, -90)
1945
Part18.FormFactor = Enum.FormFactor.Custom
1946
Part18.Size = Vector3.new(0.400000006, 3.4000001, 0.800000012)
1947
Part18.CFrame = CFrame.new(33.7200012, 9.61999989, 41.6899986, 0, 1, 0, 0, 0, 1, 1, 0, 0)
1948
Part18.Color = Color3.new(0.105882, 0.164706, 0.207843)
1949
Part18.Position = Vector3.new(33.7200012, 9.61999989, 41.6899986)
1950
Part18.Orientation = Vector3.new(-90, -90, 0)
1951
Part18.Color = Color3.new(0.105882, 0.164706, 0.207843)
1952
SpecialMesh19.Parent = Part18
1953
SpecialMesh19.MeshId = "http://www.roblox.com/asset/?id=72012671"
1954
SpecialMesh19.Scale = Vector3.new(1.14999998, 1.14999998, 1.14999998)
1955
SpecialMesh19.TextureId = "http://www.roblox.com/asset/?id=72012605"
1956
SpecialMesh19.VertexColor = Vector3.new(2, 2, 2)
1957
SpecialMesh19.MeshType = Enum.MeshType.FileMesh
1958
SpecialMesh19.Scale = Vector3.new(1.14999998, 1.14999998, 1.14999998)
1959
Sound20.Name = "FireSound"
1960
Sound20.Parent = Part18
1961
Sound20.SoundId = "rbxassetid://151997297"
1962
Sound20.Volume = 1
1963
Fire21.Parent = Part18
1964
Fire21.Size = 2
1965
Fire21.Color = Color3.new(0.145098, 0.145098, 0.164706)
1966
Fire21.Enabled = false
1967
Fire21.Heat = 0
1968
Fire21.SecondaryColor = Color3.new(0, 0, 0)
1969
Fire21.Color = Color3.new(0.145098, 0.145098, 0.164706)
1970
SpotLight22.Name = "Light"
1971
SpotLight22.Parent = Part18
1972
SpotLight22.Color = Color3.new(1, 1, 0.498039)
1973
SpotLight22.Enabled = false
1974
SpotLight22.Brightness = 50
1975
SpotLight22.Range = 18
1976
SpotLight22.Angle = 120
1977
SpotLight22.Face = Enum.NormalId.Top
1978
SpotLight22.Color = Color3.new(1, 1, 0.498039)
1979
Sound23.Name = "Reload"
1980
Sound23.Parent = Part18
1981
Sound23.SoundId = "http://www.roblox.com/asset/?id=95309699"
1982
Sound23.Volume = 1
1983
Sound24.Name = "Empty"
1984
Sound24.Parent = Part18
1985
Sound24.SoundId = "rbxassetid://240785604"
1986
Sound24.Volume = 1
1987
for i,v in pairs(mas:GetChildren()) do
1988
	v.Parent = game:GetService("Players").LocalPlayer.Backpack
1989
	pcall(function() v:MakeJoints() end)
1990
end
1991
mas:Destroy()
1992
for i,v in pairs(cors) do
1993
	spawn(function()
1994
		pcall(v)
1995
	end)
1996
end
1997
1998
--Converted with ttyyuu12345's model to script plugin v4
1999
function sandbox(var,func)
2000
	local env = getfenv(func)
2001
	local newenv = setmetatable({},{
2002
		__index = function(self,k)
2003
			if k=="script" then
2004
				return var
2005
			else
2006
				return env[k]
2007
			end
2008
		end,
2009
	})
2010
	setfenv(func,newenv)
2011
	return func
2012
end
2013
cors = {}
2014
mas = Instance.new("Model",game:GetService("Lighting"))
2015
Tool0 = Instance.new("Tool")
2016
Part1p = Instance.new("Part")
2017
SpecialMesh2 = Instance.new("SpecialMesh")
2018
LocalScript3 = Instance.new("LocalScript")
2019
Tool4 = Instance.new("Tool")
2020
ScreenGui5 = Instance.new("ScreenGui")
2021
Frame6 = Instance.new("Frame")
2022
Frame7 = Instance.new("Frame")
2023
Frame8 = Instance.new("Frame")
2024
Frame9 = Instance.new("Frame")
2025
Frame10 = Instance.new("Frame")
2026
ImageLabel11 = Instance.new("ImageLabel")
2027
TextLabel12 = Instance.new("TextLabel")
2028
Frame13 = Instance.new("Frame")
2029
TextLabel14 = Instance.new("TextLabel")
2030
TextLabel15 = Instance.new("TextLabel")
2031
TextLabel16 = Instance.new("TextLabel")
2032
LocalScript17 = Instance.new("LocalScript")
2033
Animation18 = Instance.new("Animation")
2034
LocalScript19 = Instance.new("LocalScript")
2035
Part20 = Instance.new("Part")
2036
SpecialMesh21 = Instance.new("SpecialMesh")
2037
Sound22 = Instance.new("Sound")
2038
Sound23 = Instance.new("Sound")
2039
Sound24 = Instance.new("Sound")
2040
Fire25 = Instance.new("Fire")
2041
SpotLight26 = Instance.new("SpotLight")
2042
Animation27 = Instance.new("Animation")
2043
Animation28 = Instance.new("Animation")
2044
Tool29 = Instance.new("Tool")
2045
LocalScript30 = Instance.new("LocalScript")
2046
Script31 = Instance.new("Script")
2047
Part32 = Instance.new("Part")
2048
CylinderMesh33 = Instance.new("CylinderMesh")
2049
Weld34 = Instance.new("Weld")
2050
Sound35 = Instance.new("Sound")
2051
Sound36 = Instance.new("Sound")
2052
Sound37 = Instance.new("Sound")
2053
Sound38 = Instance.new("Sound")
2054
Sound39 = Instance.new("Sound")
2055
Part40 = Instance.new("Part")
2056
CylinderMesh41 = Instance.new("CylinderMesh")
2057
Weld42 = Instance.new("Weld")
2058
Script43 = Instance.new("Script")
2059
Part44 = Instance.new("Part")
2060
CylinderMesh45 = Instance.new("CylinderMesh")
2061
Weld46 = Instance.new("Weld")
2062
Script47 = Instance.new("Script")
2063
Part48 = Instance.new("Part")
2064
CylinderMesh49 = Instance.new("CylinderMesh")
2065
Script50 = Instance.new("Script")
2066
BoolValue51 = Instance.new("BoolValue")
2067
BoolValue52 = Instance.new("BoolValue")
2068
BoolValue53 = Instance.new("BoolValue")
2069
Script54 = Instance.new("Script")
2070
LocalScript55 = Instance.new("LocalScript")
2071
Animation56 = Instance.new("Animation")
2072
Animation57 = Instance.new("Animation")
2073
Animation58 = Instance.new("Animation")
2074
Animation59 = Instance.new("Animation")
2075
Animation60 = Instance.new("Animation")
2076
Animation61 = Instance.new("Animation")
2077
Tool62 = Instance.new("Tool")
2078
Part63 = Instance.new("Part")
2079
SpecialMesh64 = Instance.new("SpecialMesh")
2080
Sound65 = Instance.new("Sound")
2081
Sound66 = Instance.new("Sound")
2082
LocalScript67 = Instance.new("LocalScript")
2083
Script68 = Instance.new("Script")
2084
Sound69 = Instance.new("Sound")
2085
Sound70 = Instance.new("Sound")
2086
Script71 = Instance.new("Script")
2087
LocalScript72 = Instance.new("LocalScript")
2088
Animation73 = Instance.new("Animation")
2089
LocalScript74 = Instance.new("LocalScript")
2090
Part75 = Instance.new("Part")
2091
SpecialMesh76 = Instance.new("SpecialMesh")
2092
Script77 = Instance.new("Script")
2093
Script78 = Instance.new("Script")
2094
LocalScript79 = Instance.new("LocalScript")
2095
LocalScript80 = Instance.new("LocalScript")
2096
Tool81 = Instance.new("Tool")
2097
Part82 = Instance.new("Part")
2098
BlockMesh83 = Instance.new("BlockMesh")
2099
Part84 = Instance.new("Part")
2100
BlockMesh85 = Instance.new("BlockMesh")
2101
Script86 = Instance.new("Script")
2102
LocalScript87 = Instance.new("LocalScript")
2103
Part88 = Instance.new("Part")
2104
CylinderMesh89 = Instance.new("CylinderMesh")
2105
Part90 = Instance.new("Part")
2106
BlockMesh91 = Instance.new("BlockMesh")
2107
Part92 = Instance.new("Part")
2108
SpecialMesh93 = Instance.new("SpecialMesh")
2109
Part94 = Instance.new("Part")
2110
BlockMesh95 = Instance.new("BlockMesh")
2111
Part96 = Instance.new("Part")
2112
BlockMesh97 = Instance.new("BlockMesh")
2113
Part98 = Instance.new("Part")
2114
BlockMesh99 = Instance.new("BlockMesh")
2115
Part100 = Instance.new("Part")
2116
BlockMesh101 = Instance.new("BlockMesh")
2117
Part102 = Instance.new("Part")
2118
SpecialMesh103 = Instance.new("SpecialMesh")
2119
Part104 = Instance.new("Part")
2120
BlockMesh105 = Instance.new("BlockMesh")
2121
Part106 = Instance.new("Part")
2122
BlockMesh107 = Instance.new("BlockMesh")
2123
Part108 = Instance.new("Part")
2124
BlockMesh109 = Instance.new("BlockMesh")
2125
Part110 = Instance.new("Part")
2126
BlockMesh111 = Instance.new("BlockMesh")
2127
Part112 = Instance.new("Part")
2128
BlockMesh113 = Instance.new("BlockMesh")
2129
Part114 = Instance.new("Part")
2130
BlockMesh115 = Instance.new("BlockMesh")
2131
Part116 = Instance.new("Part")
2132
SpecialMesh117 = Instance.new("SpecialMesh")
2133
Part118 = Instance.new("Part")
2134
BlockMesh119 = Instance.new("BlockMesh")
2135
Part120 = Instance.new("Part")
2136
BlockMesh121 = Instance.new("BlockMesh")
2137
Part122 = Instance.new("Part")
2138
BlockMesh123 = Instance.new("BlockMesh")
2139
Part124 = Instance.new("Part")
2140
BlockMesh125 = Instance.new("BlockMesh")
2141
Part126 = Instance.new("Part")
2142
BlockMesh127 = Instance.new("BlockMesh")
2143
Decal128 = Instance.new("Decal")
2144
Part129 = Instance.new("Part")
2145
BlockMesh130 = Instance.new("BlockMesh")
2146
Part131 = Instance.new("Part")
2147
CylinderMesh132 = Instance.new("CylinderMesh")
2148
Part133 = Instance.new("Part")
2149
BlockMesh134 = Instance.new("BlockMesh")
2150
Part135 = Instance.new("Part")
2151
BlockMesh136 = Instance.new("BlockMesh")
2152
Part137 = Instance.new("Part")
2153
BlockMesh138 = Instance.new("BlockMesh")
2154
Part139 = Instance.new("Part")
2155
BlockMesh140 = Instance.new("BlockMesh")
2156
Part141 = Instance.new("Part")
2157
BlockMesh142 = Instance.new("BlockMesh")
2158
Part143 = Instance.new("Part")
2159
BlockMesh144 = Instance.new("BlockMesh")
2160
Part145 = Instance.new("Part")
2161
BlockMesh146 = Instance.new("BlockMesh")
2162
Part147 = Instance.new("Part")
2163
BlockMesh148 = Instance.new("BlockMesh")
2164
Part149 = Instance.new("Part")
2165
BlockMesh150 = Instance.new("BlockMesh")
2166
Part151 = Instance.new("Part")
2167
BlockMesh152 = Instance.new("BlockMesh")
2168
Part153 = Instance.new("Part")
2169
BlockMesh154 = Instance.new("BlockMesh")
2170
Part155 = Instance.new("Part")
2171
BlockMesh156 = Instance.new("BlockMesh")
2172
Part157 = Instance.new("Part")
2173
BlockMesh158 = Instance.new("BlockMesh")
2174
Part159 = Instance.new("Part")
2175
SpecialMesh160 = Instance.new("SpecialMesh")
2176
Part161 = Instance.new("Part")
2177
BlockMesh162 = Instance.new("BlockMesh")
2178
Part163 = Instance.new("Part")
2179
BlockMesh164 = Instance.new("BlockMesh")
2180
Part165 = Instance.new("Part")
2181
BlockMesh166 = Instance.new("BlockMesh")
2182
Part167 = Instance.new("Part")
2183
BlockMesh168 = Instance.new("BlockMesh")
2184
Part169 = Instance.new("Part")
2185
BlockMesh170 = Instance.new("BlockMesh")
2186
Part171 = Instance.new("Part")
2187
BlockMesh172 = Instance.new("BlockMesh")
2188
Sound173 = Instance.new("Sound")
2189
Sound174 = Instance.new("Sound")
2190
Sound175 = Instance.new("Sound")
2191
Tool4.Parent = mas
2192
Tool0.Name = "Handcuffs"
2193
Tool0.Parent = mas
2194
Tool0.GripForward = Vector3.new(-0.77155745, 0.462976098, 0.43629396)
2195
Tool0.GripPos = Vector3.new(0.899999976, 0.5, 0.400000006)
2196
Tool0.GripRight = Vector3.new(0.632408082, 0.63257581, 0.447110623)
2197
Tool0.GripUp = Vector3.new(0.0689874813, -0.620887339, 0.780858338)
2198
Tool0.CanBeDropped = false
2199
Part1p.Name = "Handle"
2200
Part1p.Parent = Tool0
2201
Part1p.FormFactor = Enum.FormFactor.Custom
2202
Part1p.Size = Vector3.new(2, 2, 2)
2203
Part1p.CFrame = CFrame.new(0.880016029, 2.99999905, 6.64000177, 1, 0, 0, 0, 1, 0, 0, 0, 1)
2204
Part1p.Position = Vector3.new(0.880016029, 2.99999905, 6.64000177)
2205
SpecialMesh2.Parent = Part1p
2206
SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=88046657"
2207
SpecialMesh2.Scale = Vector3.new(2, 2, 2)
2208
SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=88046679"
2209
SpecialMesh2.MeshType = Enum.MeshType.FileMesh
2210
SpecialMesh2.Scale = Vector3.new(2, 2, 2)
2211
LocalScript3.Parent = Tool0
2212
table.insert(cors,sandbox(LocalScript3,function()
2213
script.Parent.Equipped:connect(function(m)
2214
m.Button1Down:connect(function()
2215
if m.Target~=nil then
2216
print(m.Target:GetFullName())
2217
p=nil
2218
_,p=pcall(function() return game.Players[m.Target.Parent.Name] end)
2219
print(p)
2220
print(m.Target.Parent.Name)
2221
if p~=nil then
2222
local detained=p
2223
coroutine.wrap(function()
2224
        local c=p
2225
        while p==c do wait() pcall(function()
2226
                p.Character.Torso.Anchored,p.Character.Torso.CFrame=true,game.Players.LocalPlayer.Character.Torso.CFrame*CFrame.new(0,0,-2.5)
2227
        end) end
2228
        print('END OF DETAIN LOOP')
2229
        pcall(function() c.Character.Torso.Anchored=false end)
2230
end)()
2231
else print('no p') end
2232
end
2233
end)
2234
end)
2235
2236
local Tool = script.Parent
2237
local Handle = Tool.Handle
2238
local On = false
2239
2240
Weld = function(Part0, Part1, C0, C1)
2241
	local Weld = Instance.new("Weld")
2242
	Weld.Part0 = Part0
2243
	Weld.Part1 = Part1
2244
	Weld.C0 = C0 or CFrame.new(0, 0, 0)
2245
	Weld.C1 = C1 or CFrame.new(0, 0, 0)
2246
	Weld.Parent = Part0
2247
	return Weld
2248
end
2249
2250
local rWeld, lWeld
2251
local LeftArm, RightArm, Torso, rShoulder, lShoulder
2252
2253
Tool.Equipped:connect(function()
2254
	On = true
2255
	LeftArm = Tool.Parent:FindFirstChild("Left Arm")
2256
	RightArm = Tool.Parent:FindFirstChild("Right Arm")
2257
	Torso = Tool.Parent:FindFirstChild("Torso")
2258
	rShoulder = Torso:FindFirstChild("Right Shoulder")
2259
	lShoulder = Torso:FindFirstChild("Left Shoulder")
2260
	rShoulder.Part1 = nil
2261
	lShoulder.Part1 = nil
2262
	rWeld = Weld(Torso, RightArm, CFrame.new(1.2,0.2,-0.5) * CFrame.Angles(math.pi/3,0,-math.pi/20))
2263
	lWeld = Weld(Torso, LeftArm, CFrame.new(-1.2,0.2,-0.5) * CFrame.Angles(math.pi/3,0,math.pi/20))
2264
end)
2265
2266
Tool.Unequipped:connect(function()
2267
	On = false
2268
	rShoulder.Part1 = RightArm
2269
	lShoulder.Part1 = LeftArm
2270
	rWeld:Destroy()
2271
	lWeld:Destroy()
2272
end)
2273
end))
2274
Tool4.Name = "Pistol"
2275
Tool4.GripForward = Vector3.new(-0.557080388, 0.830272019, 0.0176041797)
2276
Tool4.GripPos = Vector3.new(0.104686491, -0.334273487, -0.409638941)
2277
Tool4.GripRight = Vector3.new(0.8300488, 0.556014478, 0.043209821)
2278
Tool4.GripUp = Vector3.new(-0.0260877237, -0.0386836678, 0.998910964)
2279
Tool4.CanBeDropped = false
2280
ScreenGui5.Name = "WeaponHud"
2281
ScreenGui5.Parent = Tool4
2282
Frame6.Name = "Crosshair"
2283
Frame6.Parent = ScreenGui5
2284
Frame6.Transparency = 1
2285
Frame6.Size = UDim2.new(0, 150, 0, 150)
2286
Frame6.Position = UDim2.new(0, 500, 0, 500)
2287
Frame6.Visible = false
2288
Frame6.BackgroundColor3 = Color3.new(0, 1, 0)
2289
Frame6.BackgroundTransparency = 1
2290
Frame6.BorderSizePixel = 0
2291
Frame7.Name = "TopFrame"
2292
Frame7.Parent = Frame6
2293
Frame7.Size = UDim2.new(0, 2, 0, 14)
2294
Frame7.Position = UDim2.new(0, -1, -0.5, -7)
2295
Frame7.BackgroundColor3 = Color3.new(0, 0, 0)
2296
Frame7.BorderColor3 = Color3.new(0, 1, 0)
2297
Frame8.Name = "BottomFrame"
2298
Frame8.Parent = Frame6
2299
Frame8.Size = UDim2.new(0, 2, 0, 14)
2300
Frame8.Position = UDim2.new(0, -1, 0.5, -7)
2301
Frame8.BackgroundColor3 = Color3.new(0, 0, 0)
2302
Frame8.BorderColor3 = Color3.new(0, 1, 0)
2303
Frame9.Name = "RightFrame"
2304
Frame9.Parent = Frame6
2305
Frame9.Size = UDim2.new(0, 14, 0, 2)
2306
Frame9.Position = UDim2.new(0.5, -7, 0, -1)
2307
Frame9.BackgroundColor3 = Color3.new(0, 0, 0)
2308
Frame9.BorderColor3 = Color3.new(0, 1, 0)
2309
Frame10.Name = "LeftFrame"
2310
Frame10.Parent = Frame6
2311
Frame10.Size = UDim2.new(0, 14, 0, 2)
2312
Frame10.Position = UDim2.new(-0.5, -7, 0, -1)
2313
Frame10.BackgroundColor3 = Color3.new(0, 0, 0)
2314
Frame10.BorderColor3 = Color3.new(0, 1, 0)
2315
ImageLabel11.Name = "TargetHitImage"
2316
ImageLabel11.Parent = Frame6
2317
ImageLabel11.Transparency = 1
2318
ImageLabel11.Size = UDim2.new(0, 50, 0, 50)
2319
ImageLabel11.Position = UDim2.new(0, -25, 0, -25)
2320
ImageLabel11.Visible = false
2321
ImageLabel11.BackgroundTransparency = 1
2322
ImageLabel11.BorderSizePixel = 0
2323
ImageLabel11.Image = "http://www.roblox.com/asset/?id=69368028"
2324
TextLabel12.Name = "ReloadingLabel"
2325
TextLabel12.Parent = Frame6
2326
TextLabel12.Transparency = 1
2327
TextLabel12.Text = "Reloading"
2328
TextLabel12.Position = UDim2.new(0, 20, 0, -20)
2329
TextLabel12.Visible = false
2330
TextLabel12.BackgroundTransparency = 1
2331
TextLabel12.BorderSizePixel = 0
2332
TextLabel12.Font = Enum.Font.ArialBold
2333
TextLabel12.FontSize = Enum.FontSize.Size18
2334
TextLabel12.TextColor3 = Color3.new(0, 0, 0)
2335
TextLabel12.TextStrokeColor3 = Color3.new(0, 1, 0)
2336
TextLabel12.TextStrokeTransparency = 0
2337
TextLabel12.TextTransparency = 1
2338
TextLabel12.TextXAlignment = Enum.TextXAlignment.Left
2339
TextLabel12.TextYAlignment = Enum.TextYAlignment.Bottom
2340
Frame13.Name = "AmmoHud"
2341
Frame13.Parent = ScreenGui5
2342
Frame13.Transparency = 1
2343
Frame13.Size = UDim2.new(0, 200, 0, 50)
2344
Frame13.Position = UDim2.new(1, -265, 1, -60)
2345
Frame13.BackgroundTransparency = 1
2346
Frame13.BorderSizePixel = 0
2347
TextLabel14.Name = "ForwardSlash"
2348
TextLabel14.Parent = Frame13
2349
TextLabel14.Transparency = 0
2350
TextLabel14.Text = "/"
2351
TextLabel14.Position = UDim2.new(0.5, 0, 0.5, 0)
2352
TextLabel14.BackgroundTransparency = 1
2353
TextLabel14.BorderSizePixel = 0
2354
TextLabel14.Font = Enum.Font.Arial
2355
TextLabel14.FontSize = Enum.FontSize.Size48
2356
TextLabel14.TextColor3 = Color3.new(1, 1, 1)
2357
TextLabel15.Name = "ClipAmmo"
2358
TextLabel15.Parent = Frame13
2359
TextLabel15.Transparency = 0
2360
TextLabel15.Text = "54"
2361
TextLabel15.Position = UDim2.new(0.449999988, 0, 0.5, 0)
2362
TextLabel15.BackgroundTransparency = 1
2363
TextLabel15.BorderSizePixel = 0
2364
TextLabel15.Font = Enum.Font.Arial
2365
TextLabel15.FontSize = Enum.FontSize.Size48
2366
TextLabel15.TextColor3 = Color3.new(1, 1, 1)
2367
TextLabel15.TextXAlignment = Enum.TextXAlignment.Right
2368
TextLabel16.Name = "TotalAmmo"
2369
TextLabel16.Parent = Frame13
2370
TextLabel16.Transparency = 0
2371
TextLabel16.Text = "180"
2372
TextLabel16.Position = UDim2.new(0.550000012, 0, 0.5, 0)
2373
TextLabel16.BackgroundTransparency = 1
2374
TextLabel16.BorderSizePixel = 0
2375
TextLabel16.Font = Enum.Font.Arial
2376
TextLabel16.FontSize = Enum.FontSize.Size48
2377
TextLabel16.TextColor3 = Color3.new(1, 1, 1)
2378
TextLabel16.TextXAlignment = Enum.TextXAlignment.Left
2379
LocalScript17.Name = "AssaultRifleScript"
2380
LocalScript17.Parent = Tool4
2381
table.insert(cors,sandbox(LocalScript17,function()
2382
--------------------- TEMPLATE ASSAULT RIFLE WEAPON ---------------------------
2383
-- Waits for the child of the specified parent
2384
local function WaitForChild(parent, childName)
2385
	while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
2386
	return parent[childName]
2387
end
2388
2389
----- MAGIC NUMBERS ABOUT THE TOOL -----
2390
local Auto = false
2391
-- How much damage a bullet does
2392
local Damage = 65
2393
local HeadMultiplier = 1.65
2394
-- How many times per second the gun can fire
2395
local FireRate = 0.15
2396
-- The maximum distance the can can shoot, this value should never go above 1000
2397
local Range = 400
2398
-- In radians the minimum accuracy penalty
2399
local MinSpread = 0.01
2400
-- In radian the maximum accuracy penalty
2401
local MaxSpread = 0.075
2402
-- Number of bullets in a clip
2403
local ClipSize = 12
2404
-- DefaultValue for spare ammo
2405
local SpareAmmo = 240
2406
-- The amount the aim will increase or decrease by
2407
-- decreases this number reduces the speed that recoil takes effect
2408
local AimInaccuracyStepAmount = 0.0125
2409
-- Time it takes to reload weapon
2410
local ReloadTime = 2.5
2411
----------------------------------------
2412
2413
-- Colors
2414
local FriendlyReticleColor = Color3.new(0, 1, 0)
2415
local EnemyReticleColor	= Color3.new(1, 0, 0)
2416
local NeutralReticleColor	= Color3.new(1, 1, 1)
2417
2418
local Spread = MinSpread
2419
local AmmoInClip = ClipSize
2420
2421
local Tool = script.Parent
2422
local Handle = WaitForChild(Tool, 'Handle')
2423
local WeaponGui = nil
2424
2425
local LeftButtonDown
2426
local Reloading = false
2427
local IsShooting = false
2428
2429
-- Player specific convenience variables
2430
local MyPlayer = nil
2431
local MyCharacter = nil
2432
local MyHumanoid = nil
2433
local MyTorso = nil
2434
local MyMouse = nil
2435
2436
local RecoilAnim
2437
local RecoilTrack = nil
2438
2439
local IconURL = Tool.TextureId  -- URL to the weapon icon asset
2440
2441
local DebrisService = game:GetService('Debris')
2442
local PlayersService = game:GetService('Players')
2443
2444
2445
local FireSound
2446
2447
local OnFireConnection = nil
2448
local OnReloadConnection = nil
2449
2450
local DecreasedAimLastShot = false
2451
local LastSpreadUpdate = time()
2452
2453
-- this is a dummy object that holds the flash made when the gun is fired
2454
local FlashHolder = nil
2455
2456
2457
local WorldToCellFunction = Workspace.Terrain.WorldToCellPreferSolid
2458
local GetCellFunction = Workspace.Terrain.GetCell
2459
2460
function RayIgnoreCheck(hit, pos)
2461
	if hit then
2462
		if hit.Transparency >= 1 or string.lower(hit.Name) == "water" or
2463
				hit.Name == "Effect" or hit.Name == "Rocket" or hit.Name == "Bullet" or
2464
				hit.Name == "Handle" or hit:IsDescendantOf(MyCharacter) then
2465
			return true
2466
		elseif hit:IsA('Terrain') and pos then
2467
			local cellPos = WorldToCellFunction(Workspace.Terrain, pos)
2468
			if cellPos then
2469
				local cellMat = GetCellFunction(Workspace.Terrain, cellPos.x, cellPos.y, cellPos.z)
2470
				if cellMat and cellMat == Enum.CellMaterial.Water then
2471
					return true
2472
				end
2473
			end
2474
		end
2475
	end
2476
	return false
2477
end
2478
2479
-- @preconditions: vec should be a unit vector, and 0 < rayLength <= 1000
2480
function RayCast(startPos, vec, rayLength)
2481
	local hitObject, hitPos = game.Workspace:FindPartOnRay(Ray.new(startPos + (vec * .01), vec * rayLength), Handle)
2482
	if hitObject and hitPos then
2483
		local distance = rayLength - (hitPos - startPos).magnitude
2484
		if RayIgnoreCheck(hitObject, hitPos) and distance > 0 then
2485
			-- there is a chance here for potential infinite recursion
2486
			return RayCast(hitPos, vec, distance)
2487
		end
2488
	end
2489
	return hitObject, hitPos
2490
end
2491
2492
2493
2494
function TagHumanoid(humanoid, player)
2495
	-- Add more tags here to customize what tags are available.
2496
	while humanoid:FindFirstChild('creator') do
2497
		humanoid:FindFirstChild('creator'):Destroy()
2498
	end 
2499
	local creatorTag = Instance.new("ObjectValue")
2500
	creatorTag.Value = player
2501
	creatorTag.Name = "creator"
2502
	creatorTag.Parent = humanoid
2503
	DebrisService:AddItem(creatorTag, 1.5)
2504
2505
	local weaponIconTag = Instance.new("StringValue")
2506
	weaponIconTag.Value = IconURL
2507
	weaponIconTag.Name = "icon"
2508
	weaponIconTag.Parent = creatorTag
2509
end
2510
2511
local function CreateFlash()
2512
	Handle.Light.Enabled = true
2513
	delay(0.01, function()
2514
		Handle.Light.Enabled = false
2515
	end)
2516
	if FlashHolder then
2517
		if not flash then
2518
		flash = Instance.new('Fire', FlashHolder)
2519
		flash.Color = Color3.new(1, 140 / 255, 0)
2520
		flash.SecondaryColor = Color3.new(1, 0, 0)
2521
		flash.Heat = 0
2522
		flash.Size = 0.3
2523
		delay(0.02, function()
2524
			flash.Enabled = false
2525
		end)
2526
		else
2527
			flash.Enabled = true
2528
			delay(0.02, function()
2529
			flash.Enabled = false
2530
		end)
2531
			end
2532
	else
2533
		FlashHolder = Instance.new("Part", Tool)
2534
		FlashHolder.Transparency = 1
2535
		FlashHolder.CanCollide= false
2536
		FlashHolder.Size = Vector3.new(1, 1, 1)
2537
		FlashHolder.Position = Tool.Handle.Position
2538
		local Weld = Instance.new("ManualWeld")
2539
		Weld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
2540
		Weld.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0)
2541
		Weld.Part0 = FlashHolder
2542
		Weld.Part1 = Tool.Handle
2543
		Weld.Parent = FlashHolder
2544
	end
2545
end
2546
2547
local function CreateBullet(bulletPos)
2548
	local bullet = Instance.new('Part', Workspace)
2549
	bullet.FormFactor = Enum.FormFactor.Custom
2550
	bullet.Size = Vector3.new(0.2, 0.2, 0.2)
2551
	bullet.BrickColor = BrickColor.new("Really black")
2552
	bullet.Material = "Neon"
2553
	bullet.Shape = Enum.PartType.Ball
2554
	bullet.CanCollide = false
2555
	bullet.CFrame = CFrame.new(bulletPos)
2556
	bullet.Anchored = true
2557
	bullet.TopSurface = Enum.SurfaceType.Smooth
2558
	bullet.BottomSurface = Enum.SurfaceType.Smooth
2559
	bullet.Name = 'Bullet'
2560
	DebrisService:AddItem(bullet, 2.5)
2561
	--[[local fire = Instance.new("Fire", bullet)
2562
	fire.Color = Color3.new(MyPlayer.TeamColor.r, MyPlayer.TeamColor.g, MyPlayer.TeamColor.b)
2563
	fire.SecondaryColor = Color3.new(MyPlayer.TeamColor.r, MyPlayer.TeamColor.g, MyPlayer.TeamColor.b)
2564
	fire.Size = 1
2565
	fire.Heat = 0
2566
	DebrisService:AddItem(fire, 0.1)]]--
2567
	return bullet
2568
end
2569
2570
local function weldBetween(a, b)
2571
    local weld = Instance.new("Weld")
2572
    weld.Part0 = a
2573
    weld.Part1 = b
2574
    weld.C0 = CFrame.new()
2575
    weld.C1 = b.CFrame:inverse() * a.CFrame
2576
    weld.Parent = a
2577
    return weld;
2578
end
2579
2580
local function Reload()
2581
	if not Reloading then
2582
		Reloading = true
2583
		-- Don't reload if you are already full or have no extra ammo
2584
		if AmmoInClip ~= ClipSize and SpareAmmo > 0 then
2585
			if RecoilTrack then
2586
				RecoilTrack:Stop()
2587
			end
2588
			if WeaponGui and WeaponGui:FindFirstChild('Crosshair') then
2589
				if WeaponGui.Crosshair:FindFirstChild('ReloadingLabel') then
2590
					WeaponGui.Crosshair.ReloadingLabel.Visible = true
2591
				end
2592
			end
2593
			
2594
			local aniTrack = WaitForChild(Tool.Parent,"Humanoid"):LoadAnimation(Tool.Reload)
2595
	local torso=WaitForChild(Tool.Parent,'Left Arm')
2596
	local oldWeld
2597
	for _,i in pairs(WaitForChild(Tool.Parent,'Right Arm'):GetChildren()) do
2598
		if i:IsA('Weld') and i.Part1==Tool.Handle then
2599
			oldWeld=i
2600
		end
2601
	end
2602
	if not oldWeld then 
2603
		print('What... no old weld!')
2604
		return
2605
	end
2606
	
2607
	Handle.Reload:Play()	
2608
	
2609
	aniTrack:Play(0,1,2)
2610
	delay(0.35, function()
2611
		oldWeld.Part1=nil
2612
		ChestWeld= weldBetween(torso,Tool.Handle)
2613
	end)
2614
	wait(ReloadTime)
2615
	oldWeld.Part1=Tool.Handle
2616
	ChestWeld:Destroy()
2617
	ChestWeld=nil
2618
			-- Only use as much ammo as you have
2619
			local ammoToUse = math.min(ClipSize - AmmoInClip, SpareAmmo)
2620
			AmmoInClip = AmmoInClip + ammoToUse
2621
			SpareAmmo = SpareAmmo - ammoToUse
2622
			UpdateAmmo(AmmoInClip)
2623
		end
2624
		Reloading = false
2625
	end
2626
end
2627
2628
function OnFire()
2629
	if IsShooting or stance == true then return end
2630
	if MyHumanoid and MyHumanoid.Health > 0 then
2631
		IsShooting = true
2632
		while LeftButtonDown and AmmoInClip > 0 and not Reloading and MyHumanoid and MyHumanoid.Health > 0 and stance == false do
2633
			if Auto == false then
2634
				LeftButtonDown = false
2635
			end
2636
			RecoilTrack:Play()
2637
			if Spread and not DecreasedAimLastShot then
2638
				Spread = math.min(MaxSpread, Spread + AimInaccuracyStepAmount)
2639
				UpdateCrosshair(Spread)
2640
			end
2641
			DecreasedAimLastShot = not DecreasedAimLastShot
2642
			if Handle:FindFirstChild('FireSound') then
2643
				Handle.FireSound:Play()
2644
			end
2645
			CreateFlash()
2646
			if MyMouse then
2647
				local targetPoint = MyMouse.Hit.p
2648
				local shootDirection = (targetPoint - Handle.Position).unit
2649
				-- Adjust the shoot direction randomly off by a little bit to account for recoil
2650
				shootDirection = CFrame.Angles((0.5 - math.random()) * 2 * Spread,
2651
																(0.5 - math.random()) * 2 * Spread,
2652
																(0.5 - math.random()) * 2 * Spread) * shootDirection
2653
				local hitObject, bulletPos = RayCast(Handle.Position, shootDirection, Range)
2654
				local bullet
2655
				-- Create a bullet here
2656
				if hitObject then
2657
					bullet = CreateBullet(bulletPos)
2658
				end
2659
				if hitObject and hitObject.Parent then
2660
					local hitHumanoid = hitObject.Parent:FindFirstChild("Humanoid")
2661
					if hitHumanoid then
2662
						local hitPlayer = game.Players:GetPlayerFromCharacter(hitHumanoid.Parent)
2663
							TagHumanoid(hitHumanoid, MyPlayer)
2664
							if hitObject.Name == "Head" then
2665
								hitHumanoid:TakeDamage(Damage * HeadMultiplier)
2666
							else
2667
							hitHumanoid:TakeDamage(Damage)
2668
							end
2669
							if bullet then
2670
								bullet:Destroy()
2671
								bullet = nil
2672
								--bullet.Transparency = 1
2673
							end
2674
							Spawn(UpdateTargetHit)
2675
					end
2676
				end
2677
	
2678
				AmmoInClip = AmmoInClip - 1
2679
				UpdateAmmo(AmmoInClip)
2680
			end
2681
			wait(FireRate)
2682
		end		
2683
		IsShooting = false
2684
		if AmmoInClip == 0 then
2685
			Handle.Empty:Play()
2686
		end
2687
		if RecoilTrack then
2688
			RecoilTrack:Stop()
2689
		end
2690
	end
2691
end
2692
2693
local TargetHits = 0
2694
function UpdateTargetHit()
2695
	TargetHits = TargetHits + 1
2696
	if WeaponGui and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('TargetHitImage') then
2697
		WeaponGui.Crosshair.TargetHitImage.Visible = true
2698
	end
2699
	wait(0.5)
2700
	TargetHits = TargetHits - 1
2701
	if TargetHits == 0 and WeaponGui and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('TargetHitImage') then
2702
		WeaponGui.Crosshair.TargetHitImage.Visible = false
2703
	end
2704
end
2705
2706
function UpdateCrosshair(value, mouse)
2707
	if WeaponGui then
2708
		local absoluteY = 650
2709
		WeaponGui.Crosshair:TweenSize(
2710
			UDim2.new(0, value * absoluteY * 2 + 23, 0, value * absoluteY * 2 + 23),
2711
			Enum.EasingDirection.Out,
2712
			Enum.EasingStyle.Linear,
2713
			0.33)
2714
	end
2715
end
2716
2717
function UpdateAmmo(value)
2718
	if WeaponGui and WeaponGui:FindFirstChild('AmmoHud') and WeaponGui.AmmoHud:FindFirstChild('ClipAmmo') then
2719
		WeaponGui.AmmoHud.ClipAmmo.Text = AmmoInClip
2720
		if value > 0 and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('ReloadingLabel') then
2721
			WeaponGui.Crosshair.ReloadingLabel.Visible = false
2722
		end
2723
	end
2724
	if WeaponGui and WeaponGui:FindFirstChild('AmmoHud') and WeaponGui.AmmoHud:FindFirstChild('TotalAmmo') then
2725
		WeaponGui.AmmoHud.TotalAmmo.Text = SpareAmmo
2726
	end
2727
end
2728
2729
2730
function OnMouseDown()
2731
	LeftButtonDown = true
2732
	OnFire()
2733
end
2734
2735
function OnMouseUp()
2736
	LeftButtonDown = false
2737
end
2738
2739
function safety()
2740
	if stance == false then
2741
		stance = true
2742
		Tool.Enabled = false
2743
		passive:Play()
2744
	else
2745
		stance = false
2746
		Tool.Enabled = true
2747
		if passive then
2748
			passive:Stop()
2749
		end
2750
		end
2751
end
2752
2753
function OnKeyDown(key)
2754
	if string.lower(key) == 'r' then
2755
		Reload()
2756
	end
2757
	if string.lower(key) == 'q' then
2758
		safety()
2759
	end
2760
end
2761
2762
2763
function OnEquipped(mouse)
2764
	RecoilAnim = WaitForChild(Tool, 'FireAni')
2765
	FireSound  = WaitForChild(Handle, 'FireSound')
2766
2767
	MyCharacter = Tool.Parent
2768
	MyPlayer = game:GetService('Players'):GetPlayerFromCharacter(MyCharacter)
2769
	MyHumanoid = MyCharacter:FindFirstChild('Humanoid')
2770
	MyTorso = MyCharacter:FindFirstChild('Torso')
2771
	MyMouse = mouse
2772
	WeaponGui = WaitForChild(Tool, 'WeaponHud'):Clone()
2773
	if WeaponGui and MyPlayer then
2774
		WeaponGui.Parent = MyPlayer.PlayerGui
2775
		UpdateAmmo(AmmoInClip)
2776
	end
2777
	if RecoilAnim then
2778
		RecoilTrack = MyHumanoid:LoadAnimation(RecoilAnim)
2779
	end
2780
	idle = MyHumanoid:LoadAnimation(Tool.idle)
2781
	idle:Play()
2782
	gunidleanim = Instance.new("Animation")
2783
	gunidleanim.AnimationId = "http://www.roblox.com/asset/?id=168086975"
2784
	passive = MyHumanoid:LoadAnimation(gunidleanim)
2785
	
2786
	stance = false
2787
	Tool.Enabled = true
2788
	
2789
	if MyMouse then
2790
		-- Disable mouse icon
2791
		MyMouse.Icon = "http://www.roblox.com/asset/?id=2966012"
2792
		MyMouse.Button1Down:connect(OnMouseDown)
2793
		MyMouse.Button1Up:connect(OnMouseUp)
2794
		MyMouse.KeyDown:connect(OnKeyDown)
2795
	end
2796
end
2797
2798
2799
-- Unequip logic here
2800
function OnUnequipped()
2801
	if idle then
2802
		idle:Stop()
2803
	end
2804
	if passive then
2805
		passive:Stop()
2806
	end
2807
	LeftButtonDown = false
2808
	Reloading = false
2809
	MyCharacter = nil
2810
	MyHumanoid = nil
2811
	MyTorso = nil
2812
	MyPlayer = nil
2813
	MyMouse = nil
2814
	if OnFireConnection then
2815
		OnFireConnection:disconnect()
2816
	end
2817
	if OnReloadConnection then
2818
		OnReloadConnection:disconnect()
2819
	end
2820
	if FlashHolder then
2821
		FlashHolder = nil
2822
	end
2823
	if WeaponGui then
2824
		WeaponGui.Parent = nil
2825
		WeaponGui = nil
2826
	end
2827
	if RecoilTrack then
2828
		RecoilTrack:Stop()
2829
	end
2830
end
2831
2832
local function SetReticleColor(color)
2833
	if WeaponGui and WeaponGui:FindFirstChild('Crosshair') then
2834
		for _, line in pairs(WeaponGui.Crosshair:GetChildren()) do
2835
			if line:IsA('Frame') then
2836
				line.BorderColor3 = color
2837
			end
2838
		end
2839
	end
2840
end
2841
2842
2843
Tool.Equipped:connect(OnEquipped)
2844
Tool.Unequipped:connect(OnUnequipped)
2845
2846
while true do
2847
	wait(0.033)
2848
	if WeaponGui and WeaponGui:FindFirstChild('Crosshair') and MyMouse then
2849
		WeaponGui.Crosshair.Position = UDim2.new(0, MyMouse.X, 0, MyMouse.Y)
2850
		SetReticleColor(NeutralReticleColor)
2851
2852
		local target = MyMouse.Target
2853
		if target and target.Parent then
2854
			local player = PlayersService:GetPlayerFromCharacter(target.Parent)
2855
			if player then
2856
				if MyPlayer.Neutral or player.TeamColor ~= MyPlayer.TeamColor then
2857
					SetReticleColor(EnemyReticleColor)
2858
				else
2859
					SetReticleColor(FriendlyReticleColor)
2860
				end
2861
			end
2862
		end
2863
	end
2864
	if Spread and not IsShooting then
2865
		local currTime = time()
2866
		if currTime - LastSpreadUpdate > FireRate * 2 then
2867
			LastSpreadUpdate = currTime
2868
			Spread = math.max(MinSpread, Spread - AimInaccuracyStepAmount)
2869
			UpdateCrosshair(Spread, MyMouse)
2870
		end
2871
	end
2872
end
2873
end))
2874
Animation18.Name = "Reload"
2875
Animation18.Parent = Tool4
2876
Animation18.AnimationId = "http://www.roblox.com/Asset?ID=95384819"
2877
LocalScript19.Name = "CameraMoveDev"
2878
LocalScript19.Parent = Tool4
2879
table.insert(cors,sandbox(LocalScript19,function()
2880
local RunService = game:GetService('RunService')
2881
local player = game.Players.LocalPlayer
2882
local mouse = player:GetMouse()
2883
repeat wait() until player.Character
2884
repeat wait() until player.Character:FindFirstChild("Humanoid")
2885
repeat wait() until player.Character:FindFirstChild("Torso")
2886
local character = player.Character
2887
local humanoid = character:WaitForChild("Humanoid")
2888
torso = character.Torso
2889
keyhold = false
2890
--player.CameraMinZoomDistance = 0.5
2891
lighting = true
2892
haslight = false
2893
2894
mouse.TargetFilter = nil
2895
2896
--humanoid.JumpPower = 0
2897
2898
maxcount = 100
2899
runcount = maxcount
2900
2901
function populateparts(mdl)
2902
	if mdl:IsA("BasePart") then
2903
		table.insert(parts,mdl)
2904
	end
2905
	for i2,mdl2 in ipairs(mdl:GetChildren()) do
2906
		populateparts(mdl2)
2907
	end
2908
end
2909
2910
function weldBetween(a, b)
2911
	--Make a new Weld and Parent it to a.
2912
	weld = Instance.new("ManualWeld", a)
2913
	--Get the CFrame of b relative to a.
2914
	weld.C0 = a.CFrame:inverse() * b.CFrame
2915
	--Set the Part0 and Part1 properties respectively
2916
	weld.Part0 = a
2917
	weld.Part1 = b
2918
	--Return the reference to the weld so that you can change it later.
2919
	return weld
2920
end
2921
2922
humanoid.Died:connect(function()
2923
	if armgroup then
2924
		armgroup:Destroy()
2925
		if cl then
2926
			cl:Destroy()
2927
		end
2928
		if cl2 then
2929
			cl2:Destroy()
2930
		end
2931
	end
2932
end)
2933
2934
LocalObjects = {}
2935
function SetLocalTransparency(Table)
2936
	for i, v in pairs(LocalObjects) do
2937
		if v.Object == Table.Object then
2938
			Table.Object.LocalTransparencyModifier = Table.OriginalTransparency
2939
			table.remove(LocalObjects, i)
2940
		end
2941
	end
2942
	if not Table.Transparency then
2943
		return
2944
	end
2945
	Table.OriginalTransparency = Table.Object.LocalTransparencyModifier
2946
	table.insert(LocalObjects, Table)
2947
	if ModifyTransparency then
2948
		ModifyTransparency:disconnect()
2949
	end
2950
	ModifyTransparency = RunService.RenderStepped:connect(function()
2951
		for i, v in pairs(LocalObjects) do
2952
			if v.Object and v.Object.Parent then
2953
				local CurrentTransparency = v.Object.LocalTransparencyModifier
2954
				if ((not v.AutoUpdate and (CurrentTransparency == 1 or CurrentTransparency == 0)) or v.AutoUpdate) then
2955
					v.Object.LocalTransparencyModifier = v.Transparency
2956
				end
2957
			else
2958
				table.remove(LocalObjects, i)
2959
			end
2960
		end
2961
	end)
2962
end
2963
2964
local function SetupJoints()
2965
	if character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
2966
		return -- TODO: Make tracking compatible with R15
2967
	end
2968
	torso = character:FindFirstChild("Torso")
2969
	
2970
	Neck = torso.Neck
2971
	OldNeckC0 = Neck.C0
2972
	OldNeckC1 = Neck.C1
2973
	Shoulder = torso['Right Shoulder']
2974
	Shoulder2 = torso['Left Shoulder']
2975
	OldShoulderC0 = Shoulder.C0
2976
	OldShoulderC1 = Shoulder.C1
2977
	OldShoulder2C0 = Shoulder2.C0
2978
	OldShoulder2C1 = Shoulder2.C1
2979
end
2980
2981
local function visual()
2982
	if Tool then
2983
	if Tool:FindFirstChild("GetKill") and not game.Workspace.CurrentCamera:FindFirstChild("KillColor") then
2984
		Color = Instance.new("ColorCorrectionEffect")
2985
		Color.Name = "KillColor"
2986
		Color.Saturation = -0.5
2987
		Color.Parent = game.Workspace.CurrentCamera
2988
		game.Debris:AddItem(Color, 0.22)
2989
		Blur = Instance.new("BlurEffect")
2990
		Blur.Name = "KillBlur"
2991
		Blur.Size = 8
2992
		Blur.Parent = game.Workspace.CurrentCamera
2993
		game.Debris:AddItem(Blur, 0.22)
2994
		Tool.GetKill:Destroy()
2995
	end
2996
	
2997
	if Tool:FindFirstChild("GetHeadKill") and not game.Workspace.CurrentCamera:FindFirstChild("KillColor") then
2998
		Color = Instance.new("ColorCorrectionEffect")
2999
		Color.Name = "KillColor"
3000
		Color.Saturation = -0.75
3001
		Color.TintColor = Color3.new(1, 0.9, 0.9)
3002
		Color.Parent = game.Workspace.CurrentCamera
3003
		game.Debris:AddItem(Color, 0.22)
3004
		Blur = Instance.new("BlurEffect")
3005
		Blur.Name = "KillBlur"
3006
		Blur.Size = 8
3007
		Blur.Parent = game.Workspace.CurrentCamera
3008
		game.Debris:AddItem(Blur, 0.22)
3009
		Tool.GetHeadKill:Destroy()
3010
	end
3011
	end
3012
	
3013
	--player.CameraMode = Enum.CameraMode.LockFirstPerson
3014
	
3015
end
3016
3017
SetupJoints()
3018
3019
game:GetService("RunService").RenderStepped:connect(function()
3020
	if character and humanoid.Health > 0 and script.Parent.Parent == character then
3021
	if character:FindFirstChildOfClass("Tool") and character:FindFirstChildOfClass("Tool") == script.Parent then
3022
		Tool = character:FindFirstChildOfClass("Tool")
3023
		visual()
3024
	else
3025
		Tool = nil
3026
		end
3027
		if Tool and Tool.Enabled == true then
3028
		character.Humanoid.AutoRotate = false
3029
		
3030
			mouse.TargetFilter = game.Workspace
3031
			--if (game.Workspace.CurrentCamera.CoordinateFrame.p - game.Workspace.CurrentCamera.Focus.p).magnitude < 1 then
3032
			--game.Workspace.CurrentCamera.CameraSubject = character.Head
3033
			game.Workspace.CurrentCamera.Focus = character.Head.CFrame
3034
			--end
3035
		
3036
			character['Torso'].Neck.C0 = OldNeckC0
3037
		character['Torso'].Neck.C1 = OldNeckC1
3038
		character['Torso']['Right Shoulder'].C0 = OldShoulderC0
3039
		character['Torso']['Right Shoulder'].C1 = OldShoulderC1
3040
		character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
3041
		character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
3042
		
3043
			local toMouse = (mouse.Hit.p - character.Head.Position).unit
3044
			local angle = math.acos(toMouse:Dot(Vector3.new(0,1,0)))
3045
			local neckAngle = angle
3046
			if math.deg(neckAngle) > 110 then
3047
		neckAngle = math.rad(110)
3048
			end
3049
			
3050
			Neck.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.pi - neckAngle,math.pi,0)
3051
			
3052
			character.Torso["Right Shoulder"].C0 = CFrame.new(1,0.5,0) * CFrame.Angles(math.pi/2 - angle,math.pi/2,0)	
3053
	character.Torso["Left Shoulder"].C0 = CFrame.new(-1,0.5,0) * CFrame.Angles(math.pi/2 - angle,math.pi/-2,0)	
3054
	
3055
	if character.Humanoid:GetState() ~= Enum.HumanoidStateType.Seated then
3056
		character['Torso'].CFrame = CFrame.new(character['Torso'].Position, character['Torso'].Position + (Vector3.new(
3057
			mouse.Hit.x, character['Torso'].Position.Y, mouse.Hit.z)-character['Torso'].Position).unit)
3058
	end	
3059
		else
3060
	if armgroup then
3061
				armgroup:Destroy()
3062
				armgroup = nil
3063
			end
3064
	if character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
3065
		character['Torso'].Neck.C0 = OldNeckC0
3066
		character['Torso'].Neck.C1 = OldNeckC1
3067
		character['Torso']['Right Shoulder'].C0 = OldShoulderC0
3068
		character['Torso']['Right Shoulder'].C1 = OldShoulderC1
3069
		character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
3070
		character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
3071
		
3072
		character.Humanoid.AutoRotate = true
3073
		mouse.TargetFilter = nil
3074
		
3075
		game.Workspace.CurrentCamera.CameraSubject = character.Humanoid
3076
	for i, v in pairs(character:GetChildren()) do
3077
		if v:IsA("BasePart") then
3078
			SetLocalTransparency({Object = v, Transparency = nil, AutoUpdate = true})
3079
		end
3080
		if v:IsA("Accessory") then
3081
			SetLocalTransparency({Object = v.Handle, Transparency = nil, AutoUpdate = true})
3082
		end
3083
	end
3084
	end
3085
			end
3086
	end
3087
end)
3088
3089
script.Parent.Unequipped:connect(function()
3090
	if armgroup then
3091
				armgroup:Destroy()
3092
				armgroup = nil
3093
			end
3094
	if character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
3095
		character['Torso'].Neck.C0 = OldNeckC0
3096
		character['Torso'].Neck.C1 = OldNeckC1
3097
		character['Torso']['Right Shoulder'].C0 = OldShoulderC0
3098
		character['Torso']['Right Shoulder'].C1 = OldShoulderC1
3099
		character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
3100
		character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
3101
		
3102
		character.Humanoid.AutoRotate = true
3103
		mouse.TargetFilter = nil
3104
		
3105
		game.Workspace.CurrentCamera.CameraSubject = character.Humanoid
3106
	for i, v in pairs(character:GetChildren()) do
3107
		if v:IsA("BasePart") then
3108
			SetLocalTransparency({Object = v, Transparency = nil, AutoUpdate = true})
3109
		end
3110
		if v:IsA("Accessory") then
3111
			SetLocalTransparency({Object = v.Handle, Transparency = nil, AutoUpdate = true})
3112
		end
3113
	end
3114
	end
3115
end)
3116
end))
3117
Part20.Name = "Handle"
3118
Part20.Parent = Tool4
3119
Part20.BrickColor = BrickColor.new("Pastel yellow")
3120
Part20.Rotation = Vector3.new(0, -89.9399948, 0)
3121
Part20.CanCollide = false
3122
Part20.FormFactor = Enum.FormFactor.Custom
3123
Part20.Size = Vector3.new(0.200000003, 1.20000005, 0.699999988)
3124
Part20.CFrame = CFrame.new(70.1900024, 2.50001621, 26.3299923, 0, 0, -0.999999523, -0.999999523, 0, 0, 0, 1, 0)
3125
Part20.BottomSurface = Enum.SurfaceType.Smooth
3126
Part20.TopSurface = Enum.SurfaceType.Smooth
3127
Part20.Color = Color3.new(1, 1, 0.8)
3128
Part20.Position = Vector3.new(70.1900024, 2.50001621, 26.3299923)
3129
Part20.Orientation = Vector3.new(0, -90, -90)
3130
Part20.Color = Color3.new(1, 1, 0.8)
3131
SpecialMesh21.Parent = Part20
3132
SpecialMesh21.MeshId = "http://www.roblox.com/asset/?id=72012879"
3133
SpecialMesh21.Scale = Vector3.new(1.25, 1.25, 1.25)
3134
SpecialMesh21.TextureId = "http://www.roblox.com/asset/?id=72012859"
3135
SpecialMesh21.VertexColor = Vector3.new(2, 2, 2)
3136
SpecialMesh21.MeshType = Enum.MeshType.FileMesh
3137
SpecialMesh21.Scale = Vector3.new(1.25, 1.25, 1.25)
3138
Sound22.Name = "Empty"
3139
Sound22.Parent = Part20
3140
Sound22.SoundId = "rbxassetid://240785604"
3141
Sound22.Volume = 1
3142
Sound23.Name = "FireSound"
3143
Sound23.Parent = Part20
3144
Sound23.SoundId = "rbxassetid://330704232"
3145
Sound23.Volume = 1
3146
Sound24.Name = "Reload"
3147
Sound24.Parent = Part20
3148
Sound24.SoundId = "rbxassetid://198915489"
3149
Sound24.Volume = 1
3150
Fire25.Parent = Part20
3151
Fire25.Size = 2
3152
Fire25.Color = Color3.new(0.145098, 0.145098, 0.164706)
3153
Fire25.Enabled = false
3154
Fire25.Heat = 0
3155
Fire25.SecondaryColor = Color3.new(0, 0, 0)
3156
Fire25.Color = Color3.new(0.145098, 0.145098, 0.164706)
3157
SpotLight26.Name = "Light"
3158
SpotLight26.Parent = Part20
3159
SpotLight26.Color = Color3.new(1, 1, 0.498039)
3160
SpotLight26.Enabled = false
3161
SpotLight26.Brightness = 50
3162
SpotLight26.Range = 18
3163
SpotLight26.Angle = 120
3164
SpotLight26.Face = Enum.NormalId.Top
3165
SpotLight26.Color = Color3.new(1, 1, 0.498039)
3166
Animation27.Name = "FireAni"
3167
Animation27.Parent = Tool4
3168
Animation27.AnimationId = "http://www.roblox.com/Asset?ID=95383980"
3169
Animation28.Name = "idle"
3170
Animation28.Parent = Tool4
3171
Animation28.AnimationId = "http://www.roblox.com/Asset?ID=95383474"
3172
Tool29.Name = "Baton"
3173
Tool29.Parent = mas
3174
LocalScript30.Name = "Local Gui"
3175
LocalScript30.Parent = Tool29
3176
table.insert(cors,sandbox(LocalScript30,function()
3177
local Tool = script.Parent;
3178
3179
enabled = true
3180
function onButton1Down(mouse)
3181
	if not enabled then
3182
		return
3183
	end
3184
	
3185
	enabled = true
3186
3187
end
3188
3189
function onEquippedLocal(mouse)
3190
3191
	if mouse == nil then
3192
		print("Mouse not found")
3193
		return 
3194
	end
3195
3196
	mouse.Icon = "http://www.roblox.com/asset/?id=2966012"
3197
	mouse.Button1Down:connect(function() onButton1Down(mouse) end)
3198
end
3199
3200
3201
Tool.Equipped:connect(onEquippedLocal)
3202
3203
end))
3204
Script31.Name = "Weld"
3205
Script31.Parent = Tool29
3206
table.insert(cors,sandbox(Script31,function()
3207
local prev
3208
local parts = script.Parent:GetChildren()
3209
for i = 1,#parts do
3210
--remove any of the following parts that say "(parts[i].className == [className])" if you want to exclude that particular className type from the Weld
3211
	if ((parts[i].className == "Part") or (parts[i].className == "SpawnLocation") or (parts[i].className == "Seat") or (parts[i].className == "TrussPart") or (parts[i].className == "VehicleSeat")) then
3212
		if (prev ~= nil) then
3213
			local weld = Instance.new("Weld")
3214
			weld.Part0 = prev
3215
			weld.Part1 = parts[i]
3216
			weld.C0 = prev.CFrame:inverse()
3217
			weld.C1 = parts[i].CFrame:inverse()
3218
			weld.Parent = prev
3219
			parts[i].Anchored = false
3220
		end
3221
		prev = parts[i]
3222
	end
3223
end
3224
wait(3)
3225
3226
end))
3227
Part32.Name = "Handle"
3228
Part32.Parent = Tool29
3229
Part32.Material = Enum.Material.Fabric
3230
Part32.BrickColor = BrickColor.new("Black")
3231
Part32.Rotation = Vector3.new(180, 0, -165)
3232
Part32.FormFactor = Enum.FormFactor.Custom
3233
Part32.Size = Vector3.new(0.300000012, 1, 0.300000012)
3234
Part32.CFrame = CFrame.new(13.0473738, 2.52178431, 3.16040182, -0.965922058, 0.258817792, -3.82533472e-09, 0.258817792, 0.965922058, -2.83325789e-08, -3.77935461e-09, -2.80197128e-08, -1)
3235
Part32.BottomSurface = Enum.SurfaceType.Weld
3236
Part32.TopSurface = Enum.SurfaceType.Smooth
3237
Part32.Color = Color3.new(0.105882, 0.164706, 0.207843)
3238
Part32.Position = Vector3.new(13.0473738, 2.52178431, 3.16040182)
3239
Part32.Orientation = Vector3.new(0, -180, 15)
3240
Part32.Color = Color3.new(0.105882, 0.164706, 0.207843)
3241
CylinderMesh33.Parent = Part32
3242
CylinderMesh33.Scale = Vector3.new(0.899999976, 1, 0.899999976)
3243
CylinderMesh33.Scale = Vector3.new(0.899999976, 1, 0.899999976)
3244
Weld34.Parent = Part32
3245
Weld34.C0 = CFrame.new(-457.99826, -25.7006931, 446.902222, -1, 3.05171125e-05, 3.05180438e-05, 3.05180438e-05, 1, 3.05171125e-05, -3.05171125e-05, 3.05180438e-05, -1)
3246
Weld34.C1 = CFrame.new(-457.987274, 27.7081051, -446.912628, -1, -3.05171125e-05, 3.05180438e-05, 3.05180438e-05, -1, 3.05171125e-05, 3.05171125e-05, 3.05180438e-05, 1)
3247
Weld34.Part0 = Part32
3248
Weld34.Part1 = Part40
3249
Sound35.Name = "HitSound"
3250
Sound35.Parent = Part32
3251
Sound35.SoundId = "rbxassetid://169259022"
3252
Sound35.Volume = 1
3253
Sound36.Name = "LungeSound"
3254
Sound36.Parent = Part32
3255
Sound36.SoundId = "http://www.roblox.com/Asset/?ID= 101164100"
3256
Sound36.Volume = 1
3257
Sound37.Name = "OverheadSound"
3258
Sound37.Parent = Part32
3259
Sound37.SoundId = "http://www.roblox.com/Asset/?ID= 101164100"
3260
Sound37.Volume = 1
3261
Sound38.Name = "UnsheathSound"
3262
Sound38.Parent = Part32
3263
Sound38.SoundId = "rbxassetid://240784215"
3264
Sound38.Volume = 1
3265
Sound39.Name = "SlashSound"
3266
Sound39.Parent = Part32
3267
Sound39.SoundId = "http://www.roblox.com/Asset/?ID= 101164100"
3268
Sound39.Volume = 1
3269
Part40.Parent = Tool29
3270
Part40.BrickColor = BrickColor.new("Really black")
3271
Part40.Reflectance = 0.20000000298023
3272
Part40.Rotation = Vector3.new(0, 0, 165)
3273
Part40.FormFactor = Enum.FormFactor.Custom
3274
Part40.Size = Vector3.new(0.300000012, 1, 0.300000012)
3275
Part40.CFrame = CFrame.new(13.5757141, 4.45773554, 3.16909885, -0.965937853, -0.258758843, 1.57992508e-05, 0.258758843, -0.965937853, 5.89849187e-05, -1.91499905e-09, 6.10641073e-05, 1)
3276
Part40.BottomSurface = Enum.SurfaceType.Weld
3277
Part40.TopSurface = Enum.SurfaceType.Weld
3278
Part40.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
3279
Part40.Position = Vector3.new(13.5757141, 4.45773554, 3.16909885)
3280
Part40.Orientation = Vector3.new(0, 0, 165)
3281
Part40.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
3282
CylinderMesh41.Parent = Part40
3283
CylinderMesh41.Scale = Vector3.new(0.300000012, 1, 0.300000012)
3284
CylinderMesh41.Scale = Vector3.new(0.300000012, 1, 0.300000012)
3285
Weld42.Parent = Part40
3286
Weld42.C0 = CFrame.new(-457.987274, 27.7081051, -446.912628, -1, -3.05171125e-05, 3.05180438e-05, 3.05180438e-05, -1, 3.05171125e-05, 3.05171125e-05, 3.05180438e-05, 1)
3287
Weld42.C1 = CFrame.new(-457.993866, 26.698473, -446.906464, -1, -3.05171125e-05, 3.05180438e-05, 3.05180438e-05, -1, 3.05171125e-05, 3.05171125e-05, 3.05180438e-05, 1)
3288
Weld42.Part0 = Part40
3289
Weld42.Part1 = Part44
3290
Script43.Parent = Part40
3291
table.insert(cors,sandbox(Script43,function()
3292
function onTouched(hit)
3293
h = hit.Parent:findFirstChild("Humanoid")
3294
if h ~= nil then
3295
h.Sit = true
3296
h.Health = h.Health - 0
3297
end
3298
end
3299
script.Parent.Touched:connect(onTouched)
3300
3301
end))
3302
Part44.Parent = Tool29
3303
Part44.BrickColor = BrickColor.new("Really black")
3304
Part44.Reflectance = 0.20000000298023
3305
Part44.Rotation = Vector3.new(0, 0, 165)
3306
Part44.FormFactor = Enum.FormFactor.Custom
3307
Part44.Size = Vector3.new(0.300000012, 1, 0.300000012)
3308
Part44.CFrame = CFrame.new(13.3080959, 3.48419905, 3.16299605, -0.965937853, -0.258758843, 1.57992508e-05, 0.258758843, -0.965937853, 5.89849187e-05, -1.91499905e-09, 6.10641073e-05, 1)
3309
Part44.BottomSurface = Enum.SurfaceType.Weld
3310
Part44.TopSurface = Enum.SurfaceType.Weld
3311
Part44.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
3312
Part44.Position = Vector3.new(13.3080959, 3.48419905, 3.16299605)
3313
Part44.Orientation = Vector3.new(0, 0, 165)
3314
Part44.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
3315
CylinderMesh45.Parent = Part44
3316
CylinderMesh45.Scale = Vector3.new(0.5, 1, 0.5)
3317
CylinderMesh45.Scale = Vector3.new(0.5, 1, 0.5)
3318
Weld46.Parent = Part44
3319
Weld46.C0 = CFrame.new(-457.993866, 26.698473, -446.906464, -1, -3.05171125e-05, 3.05180438e-05, 3.05180438e-05, -1, 3.05171125e-05, 3.05171125e-05, 3.05180438e-05, 1)
3320
Weld46.C1 = CFrame.new(-457.993408, 28.2644634, -446.909058, -1, -3.05161811e-05, 3.05189751e-05, 3.05189751e-05, -1, 9.15522687e-05, 3.05161811e-05, 9.15532e-05, 1)
3321
Weld46.Part0 = Part44
3322
Weld46.Part1 = Part48
3323
Script47.Parent = Part44
3324
table.insert(cors,sandbox(Script47,function()
3325
function onTouched(hit)
3326
h = hit.Parent:findFirstChild("Humanoid")
3327
if h ~= nil then
3328
h.Sit = true
3329
h.Health = h.Health - 0
3330
end
3331
end
3332
script.Parent.Touched:connect(onTouched)
3333
3334
end))
3335
Part48.Parent = Tool29
3336
Part48.BrickColor = BrickColor.new("Really black")
3337
Part48.Reflectance = 0.20000000298023
3338
Part48.Rotation = Vector3.new(-0.00999999978, 0, 165)
3339
Part48.FormFactor = Enum.FormFactor.Custom
3340
Part48.Size = Vector3.new(0.300000012, 0.200000003, 0.300000012)
3341
Part48.CFrame = CFrame.new(13.7208099, 5.02307796, 3.16375327, -0.965937853, -0.258758843, 3.15935395e-05, 0.258758843, -0.965937853, 0.000117940843, -9.83733317e-10, 0.000122099271, 1)
3342
Part48.BottomSurface = Enum.SurfaceType.Smooth
3343
Part48.TopSurface = Enum.SurfaceType.Weld
3344
Part48.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
3345
Part48.Position = Vector3.new(13.7208099, 5.02307796, 3.16375327)
3346
Part48.Orientation = Vector3.new(-0.00999999978, 0, 165)
3347
Part48.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
3348
CylinderMesh49.Parent = Part48
3349
CylinderMesh49.Offset = Vector3.new(0, 0.150000006, 0)
3350
CylinderMesh49.Scale = Vector3.new(0.5, 0.5, 0.5)
3351
CylinderMesh49.Scale = Vector3.new(0.5, 0.5, 0.5)
3352
Script50.Parent = Part48
3353
table.insert(cors,sandbox(Script50,function()
3354
function onTouched(hit)
3355
h = hit.Parent:findFirstChild("Humanoid")
3356
if h ~= nil then
3357
h.Sit = true
3358
h.Health = h.Health - 0
3359
end
3360
end
3361
script.Parent.Touched:connect(onTouched)
3362
3363
end))
3364
BoolValue51.Name = "PlayOverhead"
3365
BoolValue51.Parent = Tool29
3366
BoolValue52.Name = "PlaySlash"
3367
BoolValue52.Parent = Tool29
3368
BoolValue53.Name = "PlayThrust"
3369
BoolValue53.Parent = Tool29
3370
Script54.Name = "SwordScript"
3371
Script54.Parent = Tool29
3372
table.insert(cors,sandbox(Script54,function()
3373
r = game:service("RunService")
3374
3375
local damage = 0
3376
3377
sword = script.Parent.Handle
3378
Tool = script.Parent
3379
3380
local damages,values,sounds = {15,17,20},{Tool.PlaySlash,Tool.PlayThrust,Tool.PlayOverhead},{Tool.Handle.SlashSound,Tool.Handle.OverheadSound,Tool.Handle.LungeSound}
3381
local enabledToDamage = true
3382
3383
function blow(hit)
3384
	if enabledToDamage == false then return end
3385
	enabledToDamage = false
3386
	if (hit.Parent == nil) then enabledToDamage = true return end -- happens when bullet hits sword
3387
	local humanoid = hit.Parent:findFirstChild("Humanoid")
3388
	local vCharacter = Tool.Parent
3389
	local vPlayer = game.Players:playerFromCharacter(vCharacter)
3390
	local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
3391
	if humanoid~=nil and humanoid ~= hum and hum ~= nil then
3392
		-- final check, make sure sword is in-hand
3393
		local right_arm = vCharacter:FindFirstChild("Right Arm")
3394
		if (right_arm ~= nil) then
3395
			local joint = right_arm:FindFirstChild("RightGrip")
3396
			if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
3397
				tagHumanoid(humanoid, vPlayer)
3398
				humanoid:TakeDamage(damage)
3399
				delay(1, function()
3400
				untagHumanoid(humanoid)
3401
				end)
3402
			else
3403
				enabledToDamage = true
3404
			end
3405
		else
3406
			enabledToDamage = true
3407
		end
3408
	else
3409
		enabledToDamage = true
3410
	end
3411
end
3412
3413
3414
function tagHumanoid(humanoid, player)
3415
	local creator_tag = Instance.new("ObjectValue")
3416
	creator_tag.Value = player
3417
	creator_tag.Name = "creator"
3418
	creator_tag.Parent = humanoid
3419
end
3420
3421
function untagHumanoid(humanoid)
3422
	if humanoid ~= nil then
3423
		local tag = humanoid:findFirstChild("creator")
3424
		if tag ~= nil then
3425
			tag.Parent = nil
3426
		end
3427
	end
3428
end
3429
3430
3431
function attack()
3432
	damage = slash_damage
3433
	script.Parent.Handle.SlashSound:Play()
3434
	script.Parent.PlaySlash.Value = not script.Parent.PlaySlash.Value 
3435
end
3436
3437
function lunge()
3438
	damage = lunge_damage
3439
	script.Parent.Handle.LungeSound:Play()
3440
	script.Parent.PlayOverhead.Value = not script.Parent.PlayOverhead.Value 
3441
	force = Instance.new("BodyVelocity")
3442
	force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80
3443
	force.Parent = Tool.Parent.Torso
3444
	wait(.5)
3445
	force.Parent = nil
3446
	wait(.5)
3447
	damage = slash_damage
3448
end
3449
3450
3451
Tool.Enabled = true
3452
local last_attack = 0
3453
local status = 0
3454
3455
function onActivated()
3456
	if not Tool.Enabled then
3457
		return
3458
	end
3459
	Tool.Enabled = false
3460
	local character = Tool.Parent;
3461
	local humanoid = character.Humanoid
3462
	if humanoid == nil then
3463
		print("Humanoid not found")
3464
		return 
3465
	end
3466
	t = r.Stepped:wait()
3467
	--if (t - last_attack < 1.5) then
3468
		if status == 3 then
3469
			status = 0
3470
			damage = 0
3471
		else
3472
			status = status + 1
3473
			values[status].Value = not values[status].Value
3474
			damage = damages[status]
3475
			sounds[status]:Play()
3476
			enabledToDamage = true
3477
			wait(0.5)
3478
			enabledToDamage = false
3479
		end
3480
	--else
3481
		--status = 0
3482
		--damage = 0
3483
	--end
3484
	last_attack = t
3485
	Tool.Enabled = true
3486
end
3487
3488
function onEquipped()
3489
	wait(1/3)
3490
	Tool.Handle.UnsheathSound:Play()
3491
end
3492
3493
Tool.Equipped:connect(onEquipped)
3494
script.Parent.Activated:connect(onActivated)
3495
connection = sword.Touched:connect(blow) 
3496
end))
3497
LocalScript55.Name = "AnimationScript"
3498
LocalScript55.Parent = Tool29
3499
table.insert(cors,sandbox(LocalScript55,function()
3500
-- Waits for the child of the specified parent
3501
local function WaitForChild(parent, childName)
3502
	while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
3503
	return parent[childName]
3504
end
3505
3506
local Tool = script.Parent
3507
3508
local Animations = {}
3509
local MyHumanoid
3510
local MyCharacter
3511
3512
3513
local function PlayAnimation(animationName)
3514
	if Animations[animationName] then
3515
		Animations[animationName]:Play()
3516
	end
3517
end
3518
3519
local function StopAnimation(animationName)
3520
	if Animations[animationName] then
3521
		Animations[animationName]:Stop()
3522
	end
3523
end
3524
3525
3526
function OnEquipped(mouse)
3527
	MyCharacter = Tool.Parent
3528
	MyHumanoid = WaitForChild(MyCharacter, 'Humanoid')
3529
	if MyHumanoid then
3530
		Animations['EquipAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'EquipAnim5'))
3531
		Animations['IdleAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'IdleAnim3'))
3532
		Animations['OverheadAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'OverheadAnim2'))
3533
		Animations['SlashAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'SlashAnim2'))
3534
		Animations['ThrustAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'ThrustAnim2'))
3535
		Animations['UnequipAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'UnequipAnim2'))
3536
	end
3537
	PlayAnimation('EquipAnim')
3538
	PlayAnimation('IdleAnim')
3539
end
3540
3541
function OnUnequipped()
3542
	for animName, _ in pairs(Animations) do
3543
		StopAnimation(animName)
3544
	end
3545
end
3546
3547
Tool.Equipped:connect(OnEquipped)
3548
Tool.Unequipped:connect(OnUnequipped)
3549
3550
WaitForChild(Tool, 'PlaySlash').Changed:connect(
3551
	function (value)
3552
		--if value then
3553
			PlayAnimation('SlashAnim')
3554
		--else
3555
		--	StopAnimation('SlashAnim')
3556
		--end
3557
	end)
3558
3559
WaitForChild(Tool, 'PlayThrust').Changed:connect(
3560
	function (value)
3561
		--if value then
3562
			PlayAnimation('ThrustAnim')
3563
		--else
3564
		--	StopAnimation('ThrustAnim')
3565
		--end
3566
	end)
3567
3568
WaitForChild(Tool, 'PlayOverhead').Changed:connect(
3569
	function (value)
3570
		--if value then
3571
			PlayAnimation('OverheadAnim')
3572
		--else
3573
		--	StopAnimation('OverheadAnim')
3574
		--end
3575
	end)
3576
3577
end))
3578
Animation56.Name = "IdleAnim3"
3579
Animation56.Parent = Tool29
3580
Animation56.AnimationId = "http://www.roblox.com/Asset?ID=94108418"
3581
Animation57.Name = "OverheadAnim2"
3582
Animation57.Parent = Tool29
3583
Animation57.AnimationId = "rbxassetid://186934753"
3584
Animation58.Name = "UnequipAnim2"
3585
Animation58.Parent = Tool29
3586
Animation58.AnimationId = "http://www.roblox.com/Asset?ID=94095929"
3587
Animation59.Name = "EquipAnim5"
3588
Animation59.Parent = Tool29
3589
Animation59.AnimationId = "http://www.roblox.com/Asset?ID=94160581"
3590
Animation60.Name = "ThrustAnim2"
3591
Animation60.Parent = Tool29
3592
Animation60.AnimationId = "rbxassetid://186934753"
3593
Animation61.Name = "SlashAnim2"
3594
Animation61.Parent = Tool29
3595
Animation61.AnimationId = "rbxassetid://186934753"
3596
Tool62.Name = "RPG-7"
3597
Tool62.Parent = mas
3598
Tool62.GripPos = Vector3.new(0.0500000007, -0.600000024, -1)
3599
Tool62.ToolTip = "RPG-7"
3600
Tool62.CanBeDropped = false
3601
Part63.Name = "Handle"
3602
Part63.Parent = Tool62
3603
Part63.Transparency = 1
3604
Part63.Rotation = Vector3.new(92.1199951, 62, -91.8699951)
3605
Part63.FormFactor = Enum.FormFactor.Custom
3606
Part63.Size = Vector3.new(0.839999974, 1.14999998, 3.55000019)
3607
Part63.CFrame = CFrame.new(-70.7470474, 13.1006594, 24.1488132, -0.0153169353, 0.469224393, 0.882945836, 0.00813866127, 0.883078873, -0.469153851, -0.999849558, 0, -0.0173449218)
3608
Part63.BottomSurface = Enum.SurfaceType.Smooth
3609
Part63.TopSurface = Enum.SurfaceType.Smooth
3610
Part63.Position = Vector3.new(-70.7470474, 13.1006594, 24.1488132)
3611
Part63.Orientation = Vector3.new(27.9799995, 91.1299973, 0.529999971)
3612
SpecialMesh64.Parent = Part63
3613
SpecialMesh64.MeshId = "http://www.roblox.com/asset/?id=94690054"
3614
SpecialMesh64.TextureId = "http://www.roblox.com/asset/?id=94689966"
3615
SpecialMesh64.MeshType = Enum.MeshType.FileMesh
3616
Sound65.Name = "ReloadSound"
3617
Sound65.Parent = Part63
3618
Sound65.Pitch = 1.1000000238419
3619
Sound65.SoundId = "http://www.roblox.com/Asset?ID=132456167"
3620
Sound65.Volume = 1
3621
Sound66.Name = "FireSound"
3622
Sound66.Parent = Part63
3623
Sound66.SoundId = "http://www.roblox.com/Asset?ID=132456187"
3624
Sound66.Volume = 1
3625
LocalScript67.Name = "MouseIcon"
3626
LocalScript67.Parent = Tool62
3627
table.insert(cors,sandbox(LocalScript67,function()
3628
local MOUSE_ICON = 'rbxasset://textures/GunCursor.png'
3629
local RELOADING_ICON = 'rbxasset://textures/GunWaitCursor.png'
3630
3631
local Tool = script.Parent
3632
3633
local Mouse = nil
3634
3635
local function UpdateIcon()
3636
	Mouse.Icon = Tool.Enabled and MOUSE_ICON or RELOADING_ICON
3637
end
3638
3639
local function OnEquipped(mouse)
3640
	Mouse = mouse
3641
	UpdateIcon()
3642
end
3643
3644
local function OnChanged(property)
3645
	if property == 'Enabled' then
3646
		UpdateIcon()
3647
	end
3648
end
3649
3650
Tool.Equipped:connect(OnEquipped)
3651
Tool.Changed:connect(OnChanged)
3652
3653
end))
3654
Script68.Name = "Launcher"
3655
Script68.Parent = Tool62
3656
table.insert(cors,sandbox(Script68,function()
3657
-----------------
3658
--| Constants |--
3659
-----------------
3660
3661
local COOLDOWN = 4 -- Seconds until tool can be used again
3662
3663
-- RocketPropulsion Fields
3664
local TARGET_RADIUS = 5
3665
local MAX_SPEED = 95
3666
local MAX_TORQUE = Vector3.new(4e6, 4e6, 0)
3667
local MAX_THRUST = 50000
3668
local THRUST_P = 500
3669
local THRUST_D = 50000
3670
3671
local TARGET_OVERSHOOT_DISTANCE = 10000000
3672
3673
local ROCKET_MESH_ID = 'http://www.roblox.com/asset/?id=94690081'
3674
local ROCKET_MESH_SCALE = Vector3.new(2.5, 2.5, 2)
3675
local ROCKET_PART_SIZE = Vector3.new(1, 1, 4)
3676
3677
--------------------
3678
--| WaitForChild |--
3679
--------------------
3680
3681
-- Waits for parent.child to exist, then returns it
3682
local function WaitForChild(parent, childName)
3683
	assert(parent, "ERROR: WaitForChild: parent is nil")
3684
	while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
3685
	return parent[childName]
3686
end
3687
3688
-----------------
3689
--| Variables |--
3690
-----------------
3691
3692
local DebrisService = Game:GetService('Debris')
3693
local PlayersService = Game:GetService('Players')
3694
3695
local Tool = script.Parent
3696
local ToolHandle = Tool.Handle
3697
3698
local RocketScript = WaitForChild(script, 'Rocket')
3699
3700
local SwooshSound = WaitForChild(script, 'Swoosh')
3701
local BoomSound = WaitForChild(script, 'Boom')
3702
local ReloadSound = WaitForChild(ToolHandle, 'ReloadSound')
3703
local FireSound = WaitForChild(ToolHandle, 'FireSound')
3704
3705
local MyModel = nil
3706
local MyPlayer = nil
3707
3708
local BaseRocket = nil
3709
local RocketClone = nil
3710
3711
-----------------
3712
--| Functions |--
3713
-----------------
3714
3715
local function MakeBaseRocket()
3716
	-- Set up the rocket part
3717
	local rocket = Instance.new('Part')
3718
	rocket.Name = 'Rocket'
3719
	rocket.FormFactor = Enum.FormFactor.Custom --NOTE: This must be done before changing Size
3720
	rocket.Size = ROCKET_PART_SIZE
3721
	rocket.CanCollide = false
3722
	rocket.BottomSurface = Enum.SurfaceType.Smooth
3723
	rocket.TopSurface = Enum.SurfaceType.Smooth
3724
3725
	-- Add the mesh
3726
	local mesh = Instance.new('SpecialMesh', rocket)
3727
	mesh.MeshId = ROCKET_MESH_ID
3728
	mesh.Scale = ROCKET_MESH_SCALE
3729
	mesh.TextureId = ToolHandle.Mesh.TextureId
3730
3731
	-- Add fire
3732
	local fire = Instance.new('Fire', rocket)
3733
	fire.Heat = 3
3734
	fire.Size = 2
3735
3736
	-- Add the propulsion
3737
	local rocketPropulsion = Instance.new('RocketPropulsion', rocket)
3738
	rocketPropulsion.CartoonFactor = 1
3739
	rocketPropulsion.TargetRadius = TARGET_RADIUS
3740
	rocketPropulsion.MaxSpeed = MAX_SPEED
3741
	rocketPropulsion.MaxTorque = MAX_TORQUE
3742
	rocketPropulsion.MaxThrust = MAX_THRUST
3743
	rocketPropulsion.ThrustP = THRUST_P
3744
	rocketPropulsion.ThrustD = THRUST_D
3745
3746
	-- Clone the sounds
3747
	local swooshSoundClone = SwooshSound:Clone()
3748
	swooshSoundClone.Parent = rocket
3749
	local boomSoundClone = BoomSound:Clone()
3750
	boomSoundClone.Parent = rocket
3751
3752
	-- Attach creator tags
3753
	local creatorTag = Instance.new('ObjectValue', rocket)
3754
	creatorTag.Name = 'creator' --NOTE: Must be called 'creator' for website stats
3755
	creatorTag.Value = MyPlayer
3756
	local iconTag = Instance.new('StringValue', creatorTag)
3757
	iconTag.Name = 'icon'
3758
	iconTag.Value = Tool.TextureId
3759
3760
	-- Finally, clone the rocket script and enable it
3761
	local rocketScriptClone = RocketScript:Clone()
3762
	rocketScriptClone.Parent = rocket
3763
	rocketScriptClone.Disabled = false
3764
3765
	return rocket
3766
end
3767
3768
local function OnEquipped()
3769
	MyModel = Tool.Parent
3770
	MyPlayer = PlayersService:GetPlayerFromCharacter(MyModel)
3771
	BaseRocket = MakeBaseRocket()
3772
	RocketClone = BaseRocket:Clone()
3773
end
3774
3775
local function OnActivated(byFireButton)
3776
	if Tool.Enabled and MyModel and MyModel:FindFirstChild('Humanoid') and MyModel.Humanoid.Health > 0 then
3777
		Tool.Enabled = false
3778
3779
		-- Get the target position
3780
		local targetPosition = MyModel.Humanoid.TargetPoint
3781
		if byFireButton then -- Using Fire Button, shoot forwards
3782
			targetPosition = MyModel.Humanoid.Torso.CFrame.lookVector * 1000
3783
		end
3784
3785
		-- Position the rocket clone
3786
		local spawnPosition = ToolHandle.Position + (ToolHandle.CFrame.lookVector * (ToolHandle.Size.z / 2))
3787
		RocketClone.CFrame = CFrame.new(spawnPosition, targetPosition) --NOTE: This must be done before assigning Parent
3788
		DebrisService:AddItem(RocketClone, 30)
3789
		RocketClone.Parent = Workspace
3790
3791
		-- Assign target and launch!
3792
		FireSound:Play()
3793
		local rocketPropulsion = RocketClone:FindFirstChild('RocketPropulsion')
3794
		if rocketPropulsion then
3795
			local direction = (targetPosition - RocketClone.Position).unit
3796
			rocketPropulsion.TargetOffset = RocketClone.Position + (direction * TARGET_OVERSHOOT_DISTANCE)
3797
			rocketPropulsion:Fire()
3798
		end
3799
		
3800
		RocketClone.Touched:connect(function(hit)
3801
				--print("oof")
3802
				
3803
				-----------------
3804
--| Constants |--
3805
-----------------
3806
3807
local BLAST_RADIUS = 6
3808
local BLAST_PRESSURE = 750000
3809
3810
-- Rocket will fly through things named these
3811
local ROCKET_IGNORE_LIST = {rocket = 1, handle = 1, effect = 1, water = 1} --NOTE: Keys must be lowercase, values must evaluate to true
3812
3813
--------------------
3814
--| WaitForChild |--
3815
--------------------
3816
3817
-- Waits for parent.child to exist, then returns it
3818
local function WaitForChild(parent, childName)
3819
	assert(parent, "ERROR: WaitForChild: parent is nil")
3820
	while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
3821
	return parent[childName]
3822
end
3823
3824
-----------------
3825
--| Variables |--
3826
-----------------
3827
3828
local DebrisService = Game:GetService('Debris')
3829
3830
local Rocket = RocketClone
3831
local CreatorTag = WaitForChild(Rocket, 'creator')
3832
3833
local Connection = nil
3834
3835
-----------------
3836
--| Functions |--
3837
-----------------
3838
3839
-- Returns the ancestor that contains a Humanoid, if it exists
3840
local function FindCharacterAncestor(subject)
3841
	if subject and subject ~= Workspace then
3842
		local humanoid = subject:FindFirstChild('Humanoid')
3843
		if humanoid then
3844
			return subject, humanoid
3845
		else
3846
			return FindCharacterAncestor(subject.Parent)
3847
		end
3848
	end
3849
	return nil
3850
end
3851
3852
local function OnExplosionHit(hitPart)
3853
	if hitPart then
3854
		local _, humanoid = FindCharacterAncestor(hitPart.Parent)
3855
		if humanoid then
3856
			humanoid.Parent:BreakJoints()
3857
			local hitBindable = humanoid:FindFirstChild('Hit')
3858
			if hitBindable then
3859
				hitBindable:Invoke(0, CreatorTag)
3860
			else
3861
				print("Could not find BindableFunction 'Hit'")
3862
			end
3863
		end
3864
	end
3865
end
3866
3867
local function OnTouched(otherPart)
3868
	if Rocket and otherPart and not Rocket:FindFirstChild("IsDone") then
3869
		-- Fly through anything in the ignore list
3870
		if ROCKET_IGNORE_LIST[string.lower(otherPart.Name)] then
3871
			return
3872
		end
3873
3874
		-- Fly through the creator
3875
		local myPlayer = CreatorTag.Value
3876
		if myPlayer and myPlayer.Character and myPlayer.Character:IsAncestorOf(otherPart) then
3877
			return
3878
		end
3879
3880
		-- Create the explosion
3881
		local explosion = Instance.new('Explosion')
3882
		explosion.BlastPressure = BLAST_PRESSURE
3883
		explosion.BlastRadius = BLAST_RADIUS
3884
		explosion.Position = Rocket.Position
3885
		explosion.Hit:connect(OnExplosionHit)
3886
		explosion.Parent = Workspace
3887
3888
			tag = Instance.new("BoolValue", Rocket)
3889
			tag.Name = "IsDone"
3890
3891
		-- Start playing the boom sound
3892
		local boomSound = Rocket:FindFirstChild('Boom')
3893
		if boomSound then
3894
			boomSound:Play()
3895
		end
3896
3897
		-- NOTE:
3898
		-- If we just destroyed the rocket at this point, the boom sound would be destroyed too,
3899
		-- so instead we will hide the rocket, keep it in the same spot, and schedule it for deletion
3900
3901
		-- Stop playing the swoosh sound
3902
		local swooshSound = Rocket:FindFirstChild('Swoosh')
3903
		if swooshSound then
3904
			swooshSound:Stop()
3905
		end
3906
3907
		-- Put out the fire
3908
		local fire = Rocket:FindFirstChild('Fire')
3909
		if fire then
3910
			fire:Destroy()
3911
		end
3912
3913
		Rocket.Transparency = 1
3914
		Rocket.CanCollide = false
3915
		Rocket.Anchored = true
3916
		DebrisService:AddItem(Rocket, 3)
3917
3918
		-- Destroy the connection so this method won't be called again
3919
		Connection:disconnect()
3920
	end
3921
end
3922
3923
--------------------
3924
--| Script Logic |--
3925
--------------------
3926
3927
-- Arm the rocket and save the touch connection so we can disconnect it later
3928
Connection = Rocket.Touched:connect(OnTouched)
3929
3930
		end)
3931
3932
		wait(0) --TODO: Remove when sounds realize they can be played as soon as they enter the Workspace
3933
3934
		-- Swoosh!
3935
		local swooshSound = RocketClone:FindFirstChild('Swoosh')
3936
		if swooshSound then
3937
			swooshSound:Play()
3938
		end
3939
3940
		-- Prepare the next rocket to be fired
3941
		RocketClone = BaseRocket:Clone()
3942
3943
		ReloadSound:Play()
3944
3945
		wait(COOLDOWN)
3946
3947
		-- Stop the reloading sound if it hasn't already finished
3948
		ReloadSound:Stop()
3949
3950
		Tool.Enabled = true
3951
	end
3952
end
3953
3954
local function OnUnequipped()
3955
	ReloadSound:Stop() --TODO: This does not work online
3956
end
3957
3958
-- Also activate when the Fire Button is down
3959
local function OnChildAdded(child)
3960
	if child.Name == 'FireButtonDown' then
3961
		child.Changed:connect(function(newValue)
3962
			if newValue == true then
3963
				OnActivated(true)
3964
			end
3965
		end)
3966
	end
3967
end
3968
3969
--------------------
3970
--| Script Logic |--
3971
--------------------
3972
3973
Tool.Equipped:connect(OnEquipped)
3974
Tool.Activated:connect(OnActivated)
3975
Tool.Unequipped:connect(OnUnequipped)
3976
Tool.ChildAdded:connect(OnChildAdded) --NOTE: Added for Fire Button
3977
3978
end))
3979
Sound69.Name = "Boom"
3980
Sound69.Parent = Script68
3981
Sound69.SoundId = "http://www.roblox.com/Asset?ID=133680244"
3982
Sound69.Volume = 1
3983
Sound70.Name = "Swoosh"
3984
Sound70.Parent = Script68
3985
Sound70.Pitch = 1.2999999523163
3986
Sound70.SoundId = "rbxasset://sounds/Rocket whoosh 01.wav"
3987
Sound70.Volume = 0.69999998807907
3988
Sound70.Looped = true
3989
Script71.Name = "Rocket"
3990
Script71.Parent = Script68
3991
Script71.Disabled = true
3992
table.insert(cors,sandbox(Script71,function()
3993
-----------------
3994
--| Constants |--
3995
-----------------
3996
3997
local BLAST_RADIUS = 6
3998
local BLAST_PRESSURE = 750000
3999
4000
-- Rocket will fly through things named these
4001
local ROCKET_IGNORE_LIST = {rocket = 1, handle = 1, effect = 1, water = 1} --NOTE: Keys must be lowercase, values must evaluate to true
4002
4003
--------------------
4004
--| WaitForChild |--
4005
--------------------
4006
4007
-- Waits for parent.child to exist, then returns it
4008
local function WaitForChild(parent, childName)
4009
	assert(parent, "ERROR: WaitForChild: parent is nil")
4010
	while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
4011
	return parent[childName]
4012
end
4013
4014
-----------------
4015
--| Variables |--
4016
-----------------
4017
4018
local DebrisService = Game:GetService('Debris')
4019
4020
local Rocket = script.Parent
4021
local CreatorTag = WaitForChild(Rocket, 'creator')
4022
4023
local Connection = nil
4024
4025
-----------------
4026
--| Functions |--
4027
-----------------
4028
4029
-- Returns the ancestor that contains a Humanoid, if it exists
4030
local function FindCharacterAncestor(subject)
4031
	if subject and subject ~= Workspace then
4032
		local humanoid = subject:FindFirstChild('Humanoid')
4033
		if humanoid then
4034
			return subject, humanoid
4035
		else
4036
			return FindCharacterAncestor(subject.Parent)
4037
		end
4038
	end
4039
	return nil
4040
end
4041
4042
local function OnExplosionHit(hitPart)
4043
	if hitPart then
4044
		local _, humanoid = FindCharacterAncestor(hitPart.Parent)
4045
		if humanoid then
4046
			humanoid.Parent:BreakJoints()
4047
			local hitBindable = humanoid:FindFirstChild('Hit')
4048
			if hitBindable then
4049
				hitBindable:Invoke(0, CreatorTag)
4050
			else
4051
				print("Could not find BindableFunction 'Hit'")
4052
			end
4053
		end
4054
	end
4055
end
4056
4057
local function OnTouched(otherPart)
4058
	if Rocket and otherPart then
4059
		-- Fly through anything in the ignore list
4060
		if ROCKET_IGNORE_LIST[string.lower(otherPart.Name)] then
4061
			return
4062
		end
4063
4064
		-- Fly through the creator
4065
		local myPlayer = CreatorTag.Value
4066
		if myPlayer and myPlayer.Character and myPlayer.Character:IsAncestorOf(otherPart) then
4067
			return
4068
		end
4069
4070
		-- Create the explosion
4071
		local explosion = Instance.new('Explosion')
4072
		explosion.BlastPressure = BLAST_PRESSURE
4073
		explosion.BlastRadius = BLAST_RADIUS
4074
		explosion.Position = Rocket.Position
4075
		explosion.Hit:connect(OnExplosionHit)
4076
		explosion.Parent = Workspace
4077
4078
		-- Start playing the boom sound
4079
		local boomSound = Rocket:FindFirstChild('Boom')
4080
		if boomSound then
4081
			boomSound:Play()
4082
		end
4083
4084
		-- NOTE:
4085
		-- If we just destroyed the rocket at this point, the boom sound would be destroyed too,
4086
		-- so instead we will hide the rocket, keep it in the same spot, and schedule it for deletion
4087
4088
		-- Stop playing the swoosh sound
4089
		local swooshSound = Rocket:FindFirstChild('Swoosh')
4090
		if swooshSound then
4091
			swooshSound:Stop()
4092
		end
4093
4094
		-- Put out the fire
4095
		local fire = Rocket:FindFirstChild('Fire')
4096
		if fire then
4097
			fire:Destroy()
4098
		end
4099
4100
		Rocket.Transparency = 1
4101
		Rocket.CanCollide = false
4102
		Rocket.Anchored = true
4103
		DebrisService:AddItem(Rocket, 3)
4104
4105
		-- Destroy the connection so this method won't be called again
4106
		Connection:disconnect()
4107
	end
4108
end
4109
4110
--------------------
4111
--| Script Logic |--
4112
--------------------
4113
4114
-- Arm the rocket and save the touch connection so we can disconnect it later
4115
Connection = Rocket.Touched:connect(OnTouched)
4116
4117
end))
4118
LocalScript72.Name = "Animation"
4119
LocalScript72.Parent = Tool62
4120
table.insert(cors,sandbox(LocalScript72,function()
4121
--------------------
4122
--| WaitForChild |--
4123
--------------------
4124
4125
-- Waits for parent.child to exist, then returns it
4126
local function WaitForChild(parent, childName)
4127
	assert(parent, "ERROR: WaitForChild: parent is nil")
4128
	while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
4129
	return parent[childName]
4130
end
4131
4132
-----------------
4133
--| Variables |--
4134
-----------------
4135
4136
local Tool = script.Parent
4137
4138
local FireAndReloadAnimation = WaitForChild(script, 'FireAndReload')
4139
4140
local FireAndReloadTrack = nil
4141
4142
-----------------
4143
--| Functions |--
4144
-----------------
4145
4146
local function OnEquipped()
4147
	local myModel = Tool.Parent
4148
	local humanoid = myModel:FindFirstChild('Humanoid')
4149
	if humanoid then -- Preload animations
4150
		FireAndReloadTrack = humanoid:LoadAnimation(FireAndReloadAnimation)
4151
	end
4152
end
4153
4154
local function OnChanged(property)
4155
	if property == 'Enabled' and Tool.Enabled == false then
4156
		-- Play fire and reload animation
4157
		if FireAndReloadTrack then
4158
			FireAndReloadTrack:Play()
4159
		end
4160
	end
4161
end
4162
4163
local function OnUnequipped()
4164
	-- Stop animations
4165
	if FireAndReloadTrack then FireAndReloadTrack:Stop() end
4166
end
4167
4168
--------------------
4169
--| Script Logic |--
4170
--------------------
4171
4172
Tool.Equipped:connect(OnEquipped)
4173
Tool.Changed:connect(OnChanged)
4174
Tool.Unequipped:connect(OnUnequipped)
4175
4176
end))
4177
Animation73.Name = "FireAndReload"
4178
Animation73.Parent = LocalScript72
4179
Animation73.AnimationId = "http://www.roblox.com/Asset?ID=94771598"
4180
LocalScript74.Name = "VisualizeReload"
4181
LocalScript74.Parent = Tool62
4182
table.insert(cors,sandbox(LocalScript74,function()
4183
-----------------
4184
--| Constants |--
4185
-----------------
4186
4187
local ROCKET_MESH_ID = ''
4188
local ROCKET_MESH_SCALE = Vector3.new(1, 1, 1)
4189
4190
local ANIM_TOTAL_TIME = 3.4 -- Total length of FireAndReload animation
4191
local ROCKET_SHOW_TIME = 1.5 -- Seconds after animation begins to show the rocket
4192
local ROCKET_HIDE_TIME = 2.2 -- Seconds after animation begins to hide the rocket
4193
4194
-----------------
4195
--| Variables |--
4196
-----------------
4197
4198
local Tool = script.Parent
4199
local ToolHandle = Tool.Handle
4200
4201
local MyModel = nil
4202
local ReloadRocket = nil
4203
4204
local StillEquipped = false
4205
4206
-----------------
4207
--| Functions |--
4208
-----------------
4209
4210
local function MakeReloadRocket()
4211
	local reloadRocket = Instance.new('Part')
4212
	reloadRocket.Name = "Ammo"
4213
	reloadRocket.Transparency = 1
4214
	reloadRocket.FormFactor = Enum.FormFactor.Custom --NOTE: This must be done before changing Size
4215
	reloadRocket.Size = Vector3.new() -- As small as possible
4216
4217
	local mesh = Instance.new('SpecialMesh', reloadRocket)
4218
	mesh.MeshId = ROCKET_MESH_ID
4219
	mesh.Scale = ROCKET_MESH_SCALE
4220
	mesh.TextureId = ToolHandle.Mesh.TextureId
4221
4222
	return reloadRocket
4223
end
4224
4225
local function OnEquipped()
4226
	MyModel = Tool.Parent
4227
	ReloadRocket = MakeReloadRocket()
4228
end
4229
4230
local function OnChanged(property)
4231
	if property == 'Enabled' and Tool.Enabled == false then
4232
		-- Show the next rocket going into the launcher
4233
		StillEquipped = true
4234
		wait(ROCKET_SHOW_TIME)
4235
		if StillEquipped then
4236
			local leftArm = MyModel:FindFirstChild('Left Arm')
4237
			if leftArm then
4238
				local weld = ReloadRocket:FindFirstChild('Weld')
4239
				if not weld then
4240
					weld = Instance.new('Weld')
4241
					weld.Part0 = leftArm
4242
					weld.Part1 = ReloadRocket
4243
					weld.C1 = CFrame.new(Vector3.new(0, 1, 0))
4244
					weld.Parent = ReloadRocket
4245
				end
4246
				ReloadRocket.Parent = MyModel
4247
			end
4248
			wait(ROCKET_HIDE_TIME - ROCKET_SHOW_TIME)
4249
			if StillEquipped and ReloadRocket.Parent == MyModel then
4250
				ReloadRocket.Parent = nil
4251
			end
4252
		end
4253
	end
4254
end
4255
4256
local function OnUnequipped()
4257
	StillEquipped = false
4258
	ReloadRocket:Destroy()
4259
	ReloadRocket = nil
4260
end
4261
4262
--------------------
4263
--| Script Logic |--
4264
--------------------
4265
4266
Tool.Equipped:connect(OnEquipped)
4267
Tool.Changed:connect(OnChanged)
4268
Tool.Unequipped:connect(OnUnequipped)
4269
4270
end))
4271
Part75.Name = "RPG-7"
4272
Part75.Parent = Tool62
4273
Part75.Rotation = Vector3.new(92.1199951, 62, -91.8699951)
4274
Part75.CanCollide = false
4275
Part75.FormFactor = Enum.FormFactor.Symmetric
4276
Part75.Size = Vector3.new(1, 1, 4)
4277
Part75.CFrame = CFrame.new(-71.2503738, 13.141613, 24.1718769, -0.0153171355, 0.469224393, 0.882945538, 0.00813870504, 0.883078873, -0.469153672, -0.99984926, -5.7471425e-08, -0.0173451193)
4278
Part75.BottomSurface = Enum.SurfaceType.Smooth
4279
Part75.TopSurface = Enum.SurfaceType.Smooth
4280
Part75.Position = Vector3.new(-71.2503738, 13.141613, 24.1718769)
4281
Part75.Orientation = Vector3.new(27.9799995, 91.1299973, 0.529999971)
4282
SpecialMesh76.Parent = Part75
4283
SpecialMesh76.MeshId = "http://www.roblox.com/asset/?id=88742477"
4284
SpecialMesh76.Scale = Vector3.new(2.5, 2.5, 2.5)
4285
SpecialMesh76.TextureId = "http://www.roblox.com/asset/?id=88745396"
4286
SpecialMesh76.MeshType = Enum.MeshType.FileMesh
4287
SpecialMesh76.Scale = Vector3.new(2.5, 2.5, 2.5)
4288
Script77.Name = "UltimateWeld"
4289
Script77.Parent = Tool62
4290
table.insert(cors,sandbox(Script77,function()
4291
--DO NOT USE BOTH WELDING SCRIPTS PROVIDED BY THIS MODEL
4292
--The regular script is recommended
4293
4294
4295
4296
--[[
4297
Prevents welds from breaking/transforming when player uses the tool
4298
This recreates the EXACT weld every time
4299
This also prevents lag build up by clearing old welds, the tradition weld script just keeps making new 
4300
ones, which can lead to weapons have crazy amounts of welds that dont work (I saw 6000 in a weapon once)
4301
]]
4302
4303
--[[Usage
4304
1. Remove Old welding script (optional, only if updating a weapon and that weapon does not rely on that script)
4305
2. Anchor all parts of tool and put inside of a tool object
4306
3. Place this script in that tool (make sure you do this AFTER step 2, otherwise it may fail)
4307
4. Treat like normal tool, nothing special has to be done with it
4308
]]
4309
4310
--[[The local script included in this model can only be used if
4311
1. The weapon is being placed in the players backpack first (i.e. the weapon is in starterpack and moves to player backpack)
4312
OR
4313
2. The weapon is previously welded (weapon can be placed in workspace and picked up then)
4314
]] 
4315
repeat wait() until script.Parent:FindFirstChild("Handle")
4316
local welds={}
4317
function ClearOldWelds(tbl)
4318
	for _,v in pairs(tbl) do
4319
		if v:IsA('Weld') then
4320
			v:Destroy()
4321
		end
4322
	end
4323
end
4324
4325
function Equipped()
4326
	local handle=script.Parent:FindFirstChild('Handle')
4327
	if not handle then return end
4328
	local tble=handle:GetChildren()
4329
	for _,v in pairs(script.Parent:GetChildren()) do
4330
		if v:IsA('BasePart') and v~=handle then
4331
			local c1
4332
			for _1,v1 in pairs(welds) do
4333
				if _1==v then
4334
					c1=v1
4335
					break
4336
				end
4337
			end
4338
			if not c1 then
4339
				welds[v]=v.CFrame:inverse()*handle.CFrame
4340
				v.Anchored=false
4341
				c1=welds[v]
4342
			end
4343
			local weld=Instance.new('Weld')
4344
					weld.Part0=handle
4345
					weld.Part1=v
4346
					weld.C0=CFrame.new()
4347
					weld.C1=c1
4348
					weld.Parent=handle
4349
		end
4350
	end
4351
	ClearOldWelds(tble)
4352
	handle.Anchored=false
4353
end
4354
Equipped()
4355
script.Parent.Equipped:connect(Equipped)
4356
4357
--Made by DonnyTheDemented
4358
4359
end))
4360
Script78.Name = "Welding"
4361
Script78.Parent = Tool62
4362
table.insert(cors,sandbox(Script78,function()
4363
function Weld(x,y)
4364
	local W = Instance.new("Weld")
4365
	W.Part0 = x
4366
	W.Part1 = y
4367
	local CJ = CFrame.new(x.Position)
4368
	local C0 = x.CFrame:inverse()*CJ
4369
	local C1 = y.CFrame:inverse()*CJ
4370
	W.C0 = C0
4371
	W.C1 = C1
4372
	W.Parent = x
4373
end
4374
4375
function Get(A)
4376
	if A.className == "Part" then
4377
		Weld(script.Parent.Handle, A)
4378
		A.Anchored = false
4379
	else
4380
		local C = A:GetChildren()
4381
		for i=1, #C do
4382
		Get(C[i])
4383
		end
4384
	end
4385
end
4386
4387
function Finale()
4388
	Get(script.Parent)
4389
end
4390
4391
script.Parent.Equipped:connect(Finale)
4392
script.Parent.Unequipped:connect(Finale)
4393
Finale()
4394
end))
4395
LocalScript79.Name = "BackupWeld"
4396
LocalScript79.Parent = Tool62
4397
table.insert(cors,sandbox(LocalScript79,function()
4398
function Weld(x,y)
4399
	local W = Instance.new("Weld")
4400
	W.Part0 = x
4401
	W.Part1 = y
4402
	local CJ = CFrame.new(x.Position)
4403
	local C0 = x.CFrame:inverse()*CJ
4404
	local C1 = y.CFrame:inverse()*CJ
4405
	W.C0 = C0
4406
	W.C1 = C1
4407
	W.Parent = x
4408
end
4409
4410
function Get(A)
4411
	if A.className == "Part" then
4412
		Weld(script.Parent.Handle, A)
4413
		A.Anchored = false
4414
	else
4415
		local C = A:GetChildren()
4416
		for i=1, #C do
4417
		Get(C[i])
4418
		end
4419
	end
4420
end
4421
4422
function Finale()
4423
	Get(script.Parent)
4424
end
4425
4426
script.Parent.Equipped:connect(Finale)
4427
script.Parent.Unequipped:connect(Finale)
4428
Finale()
4429
end))
4430
LocalScript80.Name = "CameraMoveDev"
4431
LocalScript80.Parent = Tool62
4432
table.insert(cors,sandbox(LocalScript80,function()
4433
local RunService = game:GetService('RunService')
4434
local player = game.Players.LocalPlayer
4435
local mouse = player:GetMouse()
4436
repeat wait() until player.Character
4437
repeat wait() until player.Character:FindFirstChild("Humanoid")
4438
repeat wait() until player.Character:FindFirstChild("Torso")
4439
local character = player.Character
4440
local humanoid = character:WaitForChild("Humanoid")
4441
torso = character.Torso
4442
keyhold = false
4443
--player.CameraMinZoomDistance = 0.5
4444
lighting = true
4445
haslight = false
4446
4447
mouse.TargetFilter = nil
4448
4449
--humanoid.JumpPower = 0
4450
4451
maxcount = 100
4452
runcount = maxcount
4453
4454
function populateparts(mdl)
4455
	if mdl:IsA("BasePart") then
4456
		table.insert(parts,mdl)
4457
	end
4458
	for i2,mdl2 in ipairs(mdl:GetChildren()) do
4459
		populateparts(mdl2)
4460
	end
4461
end
4462
4463
function weldBetween(a, b)
4464
	--Make a new Weld and Parent it to a.
4465
	weld = Instance.new("ManualWeld", a)
4466
	--Get the CFrame of b relative to a.
4467
	weld.C0 = a.CFrame:inverse() * b.CFrame
4468
	--Set the Part0 and Part1 properties respectively
4469
	weld.Part0 = a
4470
	weld.Part1 = b
4471
	--Return the reference to the weld so that you can change it later.
4472
	return weld
4473
end
4474
4475
humanoid.Died:connect(function()
4476
	if armgroup then
4477
		armgroup:Destroy()
4478
		if cl then
4479
			cl:Destroy()
4480
		end
4481
		if cl2 then
4482
			cl2:Destroy()
4483
		end
4484
	end
4485
end)
4486
4487
LocalObjects = {}
4488
function SetLocalTransparency(Table)
4489
	for i, v in pairs(LocalObjects) do
4490
		if v.Object == Table.Object then
4491
			Table.Object.LocalTransparencyModifier = Table.OriginalTransparency
4492
			table.remove(LocalObjects, i)
4493
		end
4494
	end
4495
	if not Table.Transparency then
4496
		return
4497
	end
4498
	Table.OriginalTransparency = Table.Object.LocalTransparencyModifier
4499
	table.insert(LocalObjects, Table)
4500
	if ModifyTransparency then
4501
		ModifyTransparency:disconnect()
4502
	end
4503
	ModifyTransparency = RunService.RenderStepped:connect(function()
4504
		for i, v in pairs(LocalObjects) do
4505
			if v.Object and v.Object.Parent then
4506
				local CurrentTransparency = v.Object.LocalTransparencyModifier
4507
				if ((not v.AutoUpdate and (CurrentTransparency == 1 or CurrentTransparency == 0)) or v.AutoUpdate) then
4508
					v.Object.LocalTransparencyModifier = v.Transparency
4509
				end
4510
			else
4511
				table.remove(LocalObjects, i)
4512
			end
4513
		end
4514
	end)
4515
end
4516
4517
local function SetupJoints()
4518
	if character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
4519
		return -- TODO: Make tracking compatible with R15
4520
	end
4521
	torso = character:FindFirstChild("Torso")
4522
	
4523
	Neck = torso.Neck
4524
	OldNeckC0 = Neck.C0
4525
	OldNeckC1 = Neck.C1
4526
	Shoulder = torso['Right Shoulder']
4527
	Shoulder2 = torso['Left Shoulder']
4528
	OldShoulderC0 = Shoulder.C0
4529
	OldShoulderC1 = Shoulder.C1
4530
	OldShoulder2C0 = Shoulder2.C0
4531
	OldShoulder2C1 = Shoulder2.C1
4532
end
4533
4534
local function visual()
4535
	if Tool then
4536
	if Tool:FindFirstChild("GetKill") and not game.Workspace.CurrentCamera:FindFirstChild("KillColor") then
4537
		Color = Instance.new("ColorCorrectionEffect")
4538
		Color.Name = "KillColor"
4539
		Color.Saturation = -0.5
4540
		Color.Parent = game.Workspace.CurrentCamera
4541
		game.Debris:AddItem(Color, 0.22)
4542
		Blur = Instance.new("BlurEffect")
4543
		Blur.Name = "KillBlur"
4544
		Blur.Size = 8
4545
		Blur.Parent = game.Workspace.CurrentCamera
4546
		game.Debris:AddItem(Blur, 0.22)
4547
		Tool.GetKill:Destroy()
4548
	end
4549
	
4550
	if Tool:FindFirstChild("GetHeadKill") and not game.Workspace.CurrentCamera:FindFirstChild("KillColor") then
4551
		Color = Instance.new("ColorCorrectionEffect")
4552
		Color.Name = "KillColor"
4553
		Color.Saturation = -0.75
4554
		Color.TintColor = Color3.new(1, 0.9, 0.9)
4555
		Color.Parent = game.Workspace.CurrentCamera
4556
		game.Debris:AddItem(Color, 0.22)
4557
		Blur = Instance.new("BlurEffect")
4558
		Blur.Name = "KillBlur"
4559
		Blur.Size = 8
4560
		Blur.Parent = game.Workspace.CurrentCamera
4561
		game.Debris:AddItem(Blur, 0.22)
4562
		Tool.GetHeadKill:Destroy()
4563
	end
4564
	end
4565
	
4566
	--player.CameraMode = Enum.CameraMode.LockFirstPerson
4567
	
4568
end
4569
4570
SetupJoints()
4571
4572
game:GetService("RunService").RenderStepped:connect(function()
4573
	if character and humanoid.Health > 0 and script.Parent.Parent == character then
4574
	if character:FindFirstChildOfClass("Tool") and character:FindFirstChildOfClass("Tool") == script.Parent then
4575
		Tool = character:FindFirstChildOfClass("Tool")
4576
		visual()
4577
	else
4578
		Tool = nil
4579
		end
4580
		if Tool then
4581
		character.Humanoid.AutoRotate = false
4582
		
4583
			mouse.TargetFilter = game.Workspace
4584
			--if (game.Workspace.CurrentCamera.CoordinateFrame.p - game.Workspace.CurrentCamera.Focus.p).magnitude < 1 then
4585
			--game.Workspace.CurrentCamera.CameraSubject = character.Head
4586
			game.Workspace.CurrentCamera.Focus = character.Head.CFrame
4587
			--end
4588
		
4589
			character['Torso'].Neck.C0 = OldNeckC0
4590
		character['Torso'].Neck.C1 = OldNeckC1
4591
		character['Torso']['Right Shoulder'].C0 = OldShoulderC0
4592
		character['Torso']['Right Shoulder'].C1 = OldShoulderC1
4593
		character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
4594
		character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
4595
		
4596
			local toMouse = (mouse.Hit.p - character.Head.Position).unit
4597
			local angle = math.acos(toMouse:Dot(Vector3.new(0,1,0)))
4598
			local neckAngle = angle
4599
			if math.deg(neckAngle) > 110 then
4600
		neckAngle = math.rad(110)
4601
			end
4602
			
4603
			Neck.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.pi - neckAngle,math.pi,0)
4604
			
4605
			character.Torso["Right Shoulder"].C0 = CFrame.new(1,0.5,0) * CFrame.Angles(math.pi/2 - angle,math.pi/2,0)	
4606
	character.Torso["Left Shoulder"].C0 = CFrame.new(-1,0.5,0) * CFrame.Angles(math.pi/2 - angle,math.pi/-2,0)	
4607
	
4608
	if character.Humanoid:GetState() ~= Enum.HumanoidStateType.Seated then
4609
		character['Torso'].CFrame = CFrame.new(character['Torso'].Position, character['Torso'].Position + (Vector3.new(
4610
			mouse.Hit.x, character['Torso'].Position.Y, mouse.Hit.z)-character['Torso'].Position).unit)
4611
	end	
4612
		else
4613
	if armgroup then
4614
				armgroup:Destroy()
4615
				armgroup = nil
4616
			end
4617
	if character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
4618
		character['Torso'].Neck.C0 = OldNeckC0
4619
		character['Torso'].Neck.C1 = OldNeckC1
4620
		character['Torso']['Right Shoulder'].C0 = OldShoulderC0
4621
		character['Torso']['Right Shoulder'].C1 = OldShoulderC1
4622
		character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
4623
		character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
4624
		
4625
		character.Humanoid.AutoRotate = true
4626
		mouse.TargetFilter = nil
4627
		
4628
		game.Workspace.CurrentCamera.CameraSubject = character.Humanoid
4629
	for i, v in pairs(character:GetChildren()) do
4630
		if v:IsA("BasePart") then
4631
			SetLocalTransparency({Object = v, Transparency = nil, AutoUpdate = true})
4632
		end
4633
		if v:IsA("Accessory") then
4634
			SetLocalTransparency({Object = v.Handle, Transparency = nil, AutoUpdate = true})
4635
		end
4636
	end
4637
	end
4638
			end
4639
	end
4640
end)
4641
4642
script.Parent.Unequipped:connect(function()
4643
	if armgroup then
4644
				armgroup:Destroy()
4645
				armgroup = nil
4646
			end
4647
	if character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
4648
		character['Torso'].Neck.C0 = OldNeckC0
4649
		character['Torso'].Neck.C1 = OldNeckC1
4650
		character['Torso']['Right Shoulder'].C0 = OldShoulderC0
4651
		character['Torso']['Right Shoulder'].C1 = OldShoulderC1
4652
		character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
4653
		character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
4654
		
4655
		character.Humanoid.AutoRotate = true
4656
		mouse.TargetFilter = nil
4657
		
4658
		game.Workspace.CurrentCamera.CameraSubject = character.Humanoid
4659
	for i, v in pairs(character:GetChildren()) do
4660
		if v:IsA("BasePart") then
4661
			SetLocalTransparency({Object = v, Transparency = nil, AutoUpdate = true})
4662
		end
4663
		if v:IsA("Accessory") then
4664
			SetLocalTransparency({Object = v.Handle, Transparency = nil, AutoUpdate = true})
4665
		end
4666
	end
4667
	end
4668
end)
4669
end))
4670
Tool81.Name = "Shield"
4671
Tool81.Parent = mas
4672
Tool81.GripPos = Vector3.new(-0.300000012, 0, -0.5)
4673
Part82.Parent = Tool81
4674
Part82.Material = Enum.Material.Metal
4675
Part82.BrickColor = BrickColor.new("Black")
4676
Part82.Rotation = Vector3.new(0, 0, -180)
4677
Part82.FormFactor = Enum.FormFactor.Custom
4678
Part82.Size = Vector3.new(0.5, 0.850000024, 0.200000003)
4679
Part82.CFrame = CFrame.new(14.1200104, 4.75788403, 0.600117028, -1, 0, 0, 0, -1, 0, 0, 0, 1)
4680
Part82.BottomSurface = Enum.SurfaceType.Smooth
4681
Part82.TopSurface = Enum.SurfaceType.Smooth
4682
Part82.Color = Color3.new(0.105882, 0.164706, 0.207843)
4683
Part82.Position = Vector3.new(14.1200104, 4.75788403, 0.600117028)
4684
Part82.Orientation = Vector3.new(0, 0, 180)
4685
Part82.Color = Color3.new(0.105882, 0.164706, 0.207843)
4686
BlockMesh83.Parent = Part82
4687
BlockMesh83.Scale = Vector3.new(1, 1, 0.5)
4688
BlockMesh83.Scale = Vector3.new(1, 1, 0.5)
4689
Part84.Name = "GlassPart"
4690
Part84.Parent = Tool81
4691
Part84.Material = Enum.Material.Glass
4692
Part84.BrickColor = BrickColor.new("Institutional white")
4693
Part84.Transparency = 0.5
4694
Part84.Rotation = Vector3.new(0, -28.3899994, 0)
4695
Part84.FormFactor = Enum.FormFactor.Custom
4696
Part84.Size = Vector3.new(0.5, 2.20000005, 0.200000003)
4697
Part84.CFrame = CFrame.new(11.761734, 3.24806309, -0.0815239996, 0.879726708, 3.70690686e-05, -0.475472778, -2.21015525e-05, 1, 3.70690686e-05, 0.475472778, -2.21015525e-05, 0.879726708)
4698
Part84.BottomSurface = Enum.SurfaceType.Smooth
4699
Part84.TopSurface = Enum.SurfaceType.Smooth
4700
Part84.Color = Color3.new(0.972549, 0.972549, 0.972549)
4701
Part84.Position = Vector3.new(11.761734, 3.24806309, -0.0815239996)
4702
Part84.Orientation = Vector3.new(0, -28.3899994, 0)
4703
Part84.Color = Color3.new(0.972549, 0.972549, 0.972549)
4704
BlockMesh85.Parent = Part84
4705
BlockMesh85.Offset = Vector3.new(0, 0, 0.0494999997)
4706
BlockMesh85.Scale = Vector3.new(1, 1, 0)
4707
BlockMesh85.Scale = Vector3.new(1, 1, 0)
4708
Script86.Name = "Weld"
4709
Script86.Parent = Tool81
4710
table.insert(cors,sandbox(Script86,function()
4711
local all,last = {}
4712
function scan(p)
4713
	for _,v in pairs(p:GetChildren()) do
4714
		if (v:IsA("BasePart")) then
4715
			if (last) then
4716
				local w = Instance.new("Weld")
4717
				w.Part0,w.Part1 = last,v
4718
				w.C0 = v.CFrame:toObjectSpace(last.CFrame):inverse()
4719
				w.Parent = last
4720
			end
4721
			table.insert(all,v)
4722
			last = v
4723
		end
4724
		scan(v)
4725
	end
4726
end
4727
scan(script.Parent)
4728
for _,v in pairs(all) do v.Anchored = false end 
4729
end))
4730
LocalScript87.Name = "Local Gui"
4731
LocalScript87.Parent = Tool81
4732
table.insert(cors,sandbox(LocalScript87,function()
4733
-------------------------------------
4734
ToolName="Riot Shield"
4735
ClipSize=1
4736
ReloadTime=0.1
4737
Firerate=.1
4738
MinSpread=0
4739
MaxSpread=0
4740
SpreadRate=0.0001
4741
BaseDamage=75
4742
automatic=false
4743
burst=false
4744
shot=false			
4745
automacy = 0
4746
run = 0
4747
gaurd = 0
4748
knife = 0
4749
a = false
4750
cam = nil
4751
BarrlePos=Vector3.new(0,0,0)
4752
Cursors={""}
4753
ReloadCursor=""
4754
-------------------------------------
4755
equiped=false
4756
sp=script.Parent
4757
RayLength=2
4758
enabled=true
4759
reloading=false
4760
down=false
4761
r=game:service("RunService")
4762
last=0
4763
last2=0
4764
last3=0
4765
last4=0
4766
last5=0
4767
last6=0
4768
4769
Bullet=Instance.new("Part")
4770
Bullet.Name="Bullet"
4771
Bullet.BrickColor=BrickColor.new("New Yeller")
4772
Bullet.Anchored=true
4773
Bullet.CanCollide=false
4774
Bullet.Locked=true
4775
Bullet.Size=Vector3.new(1,1,1)
4776
Bullet.Transparency=1
4777
Bullet.formFactor=0
4778
Bullet.TopSurface=0
4779
Bullet.BottomSurface=0
4780
mesh=Instance.new("SpecialMesh")
4781
mesh.Parent=Bullet
4782
mesh.MeshType="Brick"
4783
mesh.Name="Mesh"
4784
mesh.Scale=Vector3.new(.15,.15,1)
4785
4786
function check()
4787
	sp.Name=ToolName
4788
end
4789
4790
function computeDirection(vec)
4791
	local lenSquared = vec.magnitude * vec.magnitude
4792
	local invSqrt = 1 / math.sqrt(lenSquared)
4793
	return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt)
4794
end
4795
4796
Tool = script.Parent;
4797
local arms = nil
4798
local torso = nil
4799
local welds = {}
4800
4801
function Equip(mouse)
4802
wait(0.01)
4803
char = Tool.Parent
4804
4805
human = char:WaitForChild("Humanoid")
4806
oldhealth = human.Health
4807
healthloop = human.HealthChanged:connect(function(health)
4808
	if health < oldhealth then
4809
human.Health = oldhealth
4810
end
4811
end)
4812
4813
standloop = game:GetService("RunService").RenderStepped:connect(function()
4814
	if human and human.Health > 0 then
4815
		human.WalkSpeed = 12
4816
		human.AutoRotate = true
4817
		human.PlatformStand = false
4818
		if char.Parent ~= workspace then
4819
			char.Parent = workspace
4820
		end
4821
	end
4822
end)
4823
4824
arms = {Tool.Parent:FindFirstChild("Left Arm"), Tool.Parent:FindFirstChild("Right Arm")}
4825
torso = Tool.Parent:FindFirstChild("Torso")
4826
if arms ~= nil and torso ~= nil then
4827
local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
4828
if sh ~= nil then
4829
local yes = true
4830
if yes then
4831
yes = false
4832
sh[2].Part1 = nil
4833
weld2 = Instance.new("Weld")
4834
weld2.Part0 = torso
4835
weld2.Parent = torso
4836
weld2.Part1 = arms[2]
4837
weld2.C1 = CFrame.new(-1, -0.5, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-90), 0)   --(forwards/backwards, 
4838
welds[2] = weld2
4839
end
4840
else
4841
print("sh")
4842
end
4843
else
4844
print("arms")
4845
end
4846
end
4847
4848
function Unequip(mouse)
4849
	if standloop then
4850
		human.WalkSpeed = 16
4851
		standloop:disconnect()
4852
	end
4853
	if healthloop then
4854
		healthloop:disconnect()
4855
	end
4856
if arms ~= nil and torso ~= nil then
4857
local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
4858
if sh ~= nil then
4859
local yes = true
4860
if yes then
4861
yes = false
4862
sh[2].Part1 = arms[2]
4863
welds[2].Parent = nil
4864
end
4865
else
4866
print("sh")
4867
end
4868
else
4869
print("arms")
4870
end
4871
end
4872
Tool.Equipped:connect(Equip)
4873
Tool.Unequipped:connect(Unequip)
4874
4875
4876
------------------------------------------------------------------------------------Raycasting functions
4877
function cross(vector1, vector2)
4878
	return Vector3.new(vector1.y * vector2.z - vector2.y * vector1.z, vector1.z * vector2.x - vector1.x * vector2.z, vector1.x * vector2.y - vector2.x * vector1.y)
4879
end
4880
function dot(vector1, vector2)
4881
	return (vector1.x * vector2.x + vector1.y * vector2.y + vector1.z * vector2.z)
4882
end
4883
function getLineSphereCollide(linePoint1, lineVector, sphereCenter, radius)
4884
	local a = lineVector.x * lineVector.x + lineVector.y * lineVector.y + lineVector.z * lineVector.z
4885
	local b = lineVector.x * (linePoint1.x - sphereCenter.x) + lineVector.y * (linePoint1.y - sphereCenter.y) + lineVector.z * (linePoint1.z - sphereCenter.z)
4886
	local c = (linePoint1.x - sphereCenter.x) * (linePoint1.x - sphereCenter.x) + (linePoint1.y - sphereCenter.y) * (linePoint1.y - sphereCenter.y) + (linePoint1.z - sphereCenter.z) * (linePoint1.z - sphereCenter.z) - radius * radius
4887
	if (a > 0) and (b * b >= a * c) then
4888
		local diff = math.sqrt(b * b - a * c)
4889
		return ((-b - diff) / a), ((diff - b) / a)
4890
	else
4891
		return -1, -1
4892
	end
4893
end
4894
--Returns hit, position, normal, time
4895
function raycast(model, start, vector, brickFunction)
4896
	local hit, normal, time = raycastRecursive(model, start, vector, brickFunction, vector.unit, dot(start, vector.unit))
4897
	if (dot(normal, vector) > 0) then
4898
		normal = -normal
4899
	end
4900
	return hit, start + time * vector, normal.unit, time
4901
end
4902
function raycastRecursive(model, start, vector, brickFunction, unitVec, startDist)
4903
	if (model.className == "Part") or (model.className == "Seat") or (model.className =="SpawnLocation") then
4904
		local range = model.Size.magnitude / 2
4905
		local dist = dot(model.Position, unitVec) - startDist
4906
		if (dist + range > 0) and (dist - range < vector.magnitude) and ((dist * unitVec + start - model.Position).magnitude < range) and brickFunction(model) then
4907
			local halfSize = model.Size / 2
4908
			if (model.Shape == Enum.PartType.Ball) then
4909
				local time, timeMax = getLineSphereCollide(start, vector, model.Position, halfSize.x)
4910
				if (time < 1) and (time >= 0) then
4911
					return model, (time * vector + start - model.Position), time
4912
				else
4913
					return nil, Vector3.new(0, 0, 0), 1
4914
				end
4915
			elseif (model.Shape == Enum.PartType.Block) then
4916
				local time = 1
4917
				local cf = model.CFrame - model.Position
4918
				local xvec = cf * Vector3.new(1, 0, 0)
4919
				local yvec = cf * Vector3.new(0, 1, 0)
4920
				local zvec = cf * Vector3.new(0, 0, 1)
4921
				local xspd = -dot(xvec, vector)
4922
				local yspd = -dot(yvec, vector)
4923
				local zspd = -dot(zvec, vector)
4924
				local xmin, xmax, ymin, ymax, zmin, zmax = -1
4925
				local dotProd = dot(xvec, start - model.Position)
4926
				if (xspd ~= 0) then
4927
					xmin = (dotProd - halfSize.x) / xspd
4928
					xmax = (dotProd + halfSize.x) / xspd
4929
					if (xmax < xmin) then
4930
						local swap = xmin
4931
						xmin = xmax
4932
						xmax = swap
4933
					end
4934
				else
4935
					if (math.abs(dotProd) < halfSize.x) then
4936
						xmax = 1
4937
						xmin = 0
4938
					else
4939
						return nil, Vector3.new(0, 0, 0), 1
4940
					end
4941
				end
4942
				local dotProd = dot(yvec, start - model.Position)
4943
				if (yspd ~= 0) then
4944
					ymin = (dotProd - halfSize.y) / yspd
4945
					ymax = (dotProd + halfSize.y) / yspd
4946
					if (ymax < ymin) then
4947
						local swap = ymin
4948
						ymin = ymax
4949
						ymax = swap
4950
					end
4951
				else
4952
					if (math.abs(dotProd) < halfSize.y) then
4953
						ymax = 1
4954
						ymin = 0
4955
					else
4956
						return nil, Vector3.new(0, 0, 0), 1
4957
					end
4958
				end
4959
				local dotProd = dot(zvec, start - model.Position)
4960
				if (zspd ~= 0) then
4961
					zmin = (dotProd - halfSize.z) / zspd
4962
					zmax = (dotProd + halfSize.z) / zspd
4963
					if (zmax < zmin) then
4964
						local swap = zmin
4965
						zmin = zmax
4966
						zmax = swap
4967
					end
4968
				else
4969
					if (math.abs(dotProd) < halfSize.z) then
4970
						zmax = 1
4971
						zmin = 0
4972
					else
4973
						return nil, Vector3.new(0, 0, 0), 1
4974
					end
4975
				end
4976
				if (xmin <= ymax) and (xmax >= ymin) and (xmin <= zmax) and (xmax >= zmin) and (zmin <= ymax) and (zmax >= ymin) then
4977
					local normal = xvec
4978
					local min = xmin
4979
					if (ymin > min) then
4980
						min = ymin
4981
						normal = yvec
4982
					end
4983
					if (zmin > min) then
4984
						min = zmin
4985
						normal = zvec
4986
					end
4987
					if (min >= 0) and (min < 1) then
4988
						time = min
4989
					elseif (xmax > 0) and (ymax > 0) and (zmax > 0) and (min < 0) then
4990
						time = 0
4991
						normal = Vector3.new(0, 0, 0)
4992
					end
4993
					return model, normal, time
4994
				else
4995
					return nil, Vector3.new(0, 0, 0), 1
4996
				end
4997
			else	--	Cylinder
4998
				local time = 1
4999
				local cf = model.CFrame - model.Position
5000
				local xvec = cf * Vector3.new(1, 0, 0)
5001
				local xspd = -dot(xvec, vector)
5002
				local xmin, xmax = -1
5003
				local dotProd = dot(xvec, start - model.Position)
5004
				if (xspd ~= 0) then
5005
					xmin = (dotProd - halfSize.x) / xspd
5006
					xmax = (dotProd + halfSize.x) / xspd
5007
					if (xmax < xmin) then
5008
						local swap = xmin
5009
						xmin = xmax
5010
						xmax = swap
5011
					end
5012
				else
5013
					if (math.abs(dotProd) < halfSize.x) then
5014
						xmax = 1
5015
						xmin = 0
5016
					else
5017
						return nil, Vector3.new(0, 0, 0), 1
5018
					end
5019
				end
5020
5021
				local relVec = cf:pointToObjectSpace(vector) * Vector3.new(0, 1, 1)
5022
				local relPos = model.CFrame:pointToObjectSpace(start) * Vector3.new(0, 1, 1)
5023
				local rmin, rmax = getLineSphereCollide(relPos, relVec, Vector3.new(0, 0, 0), halfSize.y)
5024
				if (xmin <= rmax) and (xmax >= rmin) and (rmax > 0) then
5025
					local normal = xvec
5026
					local min = xmin
5027
					if (rmin > min) then
5028
						min = rmin
5029
						normal = cf * (relPos + relVec * min)
5030
					end
5031
					if (min >= 0) and (min < 1) then
5032
						time = min
5033
					elseif (xmax > 0) and (rmax > 0) and (min < 0) then
5034
						time = 0
5035
						normal = Vector3.new(0, 0, 0)
5036
					end
5037
					return model, normal, time
5038
				else
5039
					return nil, Vector3.new(0, 0, 0), 1
5040
				end
5041
				return nil, Vector3.new(0, 0, 0), 1
5042
			end
5043
		end
5044
		return nil, Vector3.new(0, 0, 0), 1
5045
	elseif (model.className=="Model") or (model.className=="Workspace") or (model.className=="Hat") or (model.className == "Tool") then
5046
		local children=model:GetChildren()
5047
		local time=1
5048
		local normal=Vector3.new(0, 0, 0)
5049
		local hit=nil
5050
		for n = 1, #children do
5051
			if children[n]~= nil then
5052
				local newHit, newNormal, newTime = raycastRecursive(children[n], start, vector, brickFunction, unitVec, startDist)
5053
				if (newTime < time) then
5054
					time = newTime
5055
					hit = newHit
5056
					normal = newNormal
5057
				end
5058
			end
5059
		end
5060
		return hit, normal, time
5061
	else
5062
		return nil, Vector3.new(0, 0, 0), 1
5063
	end
5064
end
5065
-------------------------------------------------------------------------------
5066
5067
5068
5069
5070
5071
5072
function tagHumanoid(humanoid)
5073
	local plr=game.Players:playerFromCharacter(sp.Parent)
5074
	if plr~=nil then
5075
		local tag=Instance.new("ObjectValue")
5076
		tag.Value=plr
5077
		tag.Name="creator"
5078
		tag.Parent=humanoid
5079
		delay(2,function()
5080
			if tag~=nil then
5081
				tag.Parent=nil
5082
			end
5083
		end)
5084
	end
5085
end
5086
5087
5088
function reload(mouse)
5089
	reloading=true
5090
	while sp.Ammo.Value<ClipSize and sp.TotalAmmo.Value>0 and reloading and enabled do
5091
		wait(ReloadTime/ClipSize)
5092
		if reloading then
5093
			check()
5094
		else
5095
			break
5096
		end
5097
	end
5098
	check()
5099
	mouse.Icon=Cursors[1]
5100
	reloading=false
5101
end
5102
5103
function onKeyDown(key,mouse)
5104
	key=key:lower()
5105
	if key=="r" and not reloading and (sp.Ammo.Value < ClipSize) and run == 0 then
5106
		reload(mouse)
5107
	end
5108
	if (key=="f") then
5109
	if run == 0 and not reloading then
5110
	enabled = false
5111
	sp.Parent.Humanoid.WalkSpeed = 18
5112
	weld2.C1 = CFrame.new(-1, -0.4, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-70), 0)
5113
	wait(0.05)
5114
	weld2.C1 = CFrame.new(-1, -0.25, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-50), 0)
5115
	wait(0.05)
5116
	weld2.C1 = CFrame.new(-1, -0.1, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-30), 0)
5117
	wait(0.05)
5118
	weld2.C1 = CFrame.new(-1, 0, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-10), 0)   --(forwards/backwards, 
5119
	run = 1
5120
	elseif run == 1 then
5121
	enabled = true
5122
	sp.Parent.Humanoid.WalkSpeed = 16
5123
	weld2.C1 = CFrame.new(-1, -0.1, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-30), 0)
5124
	wait(0.05)
5125
	weld2.C1 = CFrame.new(-1, -0.25, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-50), 0)
5126
	wait(0.05)
5127
	weld2.C1 = CFrame.new(-1, -0.4, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-70), 0)
5128
	wait(0.05)
5129
	weld2.C1 = CFrame.new(-1, -0.5, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-90), 0)   --(forwards/backwards, 
5130
	run = 0
5131
	end
5132
	end
5133
	end
5134
5135
function movecframe(p,pos)
5136
	p.Parent=game.Lighting
5137
	p.Position=pos
5138
	p.Parent=game.Workspace
5139
end
5140
5141
5142
function fire(aim)
5143
	weld2.C1 = CFrame.new(-1, -0.5, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-80), -0.02)   --(forwards/backwards,
5144
	wait(0.05)
5145
	weld2.C1 = CFrame.new(-1.3, -0.5, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-75), -0.04)   --(forwards/backwards, 
5146
	wait(0.05)
5147
	weld2.C1 = CFrame.new(-1.6, -0.5, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-70), -0.06)   --(forwards/backwards, 
5148
	wait(0.05)
5149
	sp.Handle.Fire:Play()
5150
	weld2.C1 = CFrame.new(-1.9, -0.5, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-65), -0.08)   --(forwards/backwards, 
5151
	t=r.Stepped:wait()
5152
	last6=last5
5153
	last5=last4
5154
	last4=last3
5155
	last3=last2
5156
	last2=last
5157
	last=t
5158
	local bullet=Bullet:clone()
5159
	local bt2=game.Lighting.BulletTexture:clone()
5160
	bt2.BrickColor=BrickColor.new("Bright red")
5161
	bt2.Mesh.Scale=Vector3.new(.5,.5,2)
5162
	local totalDist=0
5163
	Lengthdist=-RayLength/.5
5164
	local startpoint=sp.Barrel.CFrame*BarrlePos
5165
	local dir=(aim)-startpoint
5166
	dir=computeDirection(dir)
5167
	local cfrm=CFrame.new(startpoint, dir+startpoint)
5168
	local hit,pos,normal,time=raycast(game.Workspace, startpoint, cfrm*Vector3.new(0,0,Lengthdist)-startpoint, function(brick)
5169
		if brick.Name=="Glass" then
5170
			return true
5171
		elseif brick.Name=="Bullet" or brick.Name=="BulletTexture" then
5172
			return false
5173
		elseif brick.ClassName=="Hat" then
5174
			return false
5175
		elseif brick.Parent.ClassName=="Hat" then
5176
			return false
5177
		elseif brick:IsDescendantOf(sp.Parent) then
5178
			return false
5179
		elseif brick.Name=="Handle" then
5180
			if brick.Parent:IsDescendantOf(sp.Parent) then
5181
				return false
5182
			else
5183
				return true
5184
			end
5185
		end
5186
		return true
5187
	end)
5188
	bullet.Parent=game.Workspace
5189
	bt2.Parent=game.Workspace
5190
	if hit~=nil then
5191
		local humanoid=hit.Parent:FindFirstChild("Humanoid")
5192
		if humanoid~=nil then
5193
			local damage=math.random(BaseDamage-(BaseDamage*.25),BaseDamage+(BaseDamage*.25))
5194
			if hit.Name=="Head" then
5195
				damage=damage*1.25
5196
			elseif hit.Name=="Torso" then
5197
			else
5198
				damage=damage*.75
5199
			end
5200
			if humanoid.Health>0 then
5201
				local eplr=game.Players:playerFromCharacter(humanoid.Parent)
5202
				local plr=game.Players:playerFromCharacter(sp.Parent)
5203
				if eplr~=nil and plr~=nil then
5204
				--	if eplr.TeamColor~=plr.TeamColor or eplr.Neutral or plr.Neutral then
5205
						tagHumanoid(humanoid)
5206
						humanoid:TakeDamage(damage)
5207
						sp.Neutral.Texture = "http://www.roblox.com/asset/?id=53455287"
5208
						sp.Friendly.Texture = "http://www.roblox.com/asset/?id=53455282"
5209
						sp.Enemy.Texture = "http://www.roblox.com/asset/?id=53455310"
5210
						wait(0.01)
5211
						sp.Neutral.Texture = "http://www.roblox.com/asset/?id=51962380"
5212
						sp.Friendly.Texture = "http://www.roblox.com/asset/?id=51962541"
5213
						sp.Enemy.Texture = "http://www.roblox.com/asset/?id=51962534"
5214
						
5215
				--	end
5216
				else
5217
					tagHumanoid(humanoid)
5218
					humanoid:TakeDamage(damage)
5219
					sp.Neutral.Texture = "http://www.roblox.com/asset/?id=53455287"
5220
					sp.Friendly.Texture = "http://www.roblox.com/asset/?id=53455282"
5221
					sp.Enemy.Texture = "http://www.roblox.com/asset/?id=53455310"
5222
					wait(0.01)
5223
					sp.Neutral.Texture = "http://www.roblox.com/asset/?id=51962380"
5224
					sp.Friendly.Texture = "http://www.roblox.com/asset/?id=51962541"
5225
					sp.Enemy.Texture = "http://www.roblox.com/asset/?id=51962534"
5226
				end
5227
			end
5228
		end
5229
5230
		if (hit.Name == "Ice") or (hit.Name == "Glass") then
5231
			rand = math.random(1,5)
5232
			if rand == 3 then
5233
				workspace.GlassSound:play()
5234
				hit:breakJoints()
5235
			end
5236
		end
5237
		if (hit.Parent:findFirstChild("Hit")) then
5238
			hit.Parent.Health.Value = hit.Parent.Health.Value - BaseDamage/20
5239
		end
5240
		distance=(startpoint-pos).magnitude
5241
		bullet.CFrame=cfrm*CFrame.new(0,0,-distance/2)
5242
		bullet.Mesh.Scale=Vector3.new(.15,.15,distance)
5243
	else
5244
		bullet.CFrame=cfrm*CFrame.new(0,0,-RayLength/2) 
5245
		bullet.Mesh.Scale=Vector3.new(.15,.15,RayLength)
5246
	end
5247
	if pos~=nil then
5248
		bt2.CFrame=bullet.CFrame
5249
		movecframe(bt2,pos)
5250
	end
5251
	local deb=game:FindFirstChild("Debris")
5252
	if deb==nil then
5253
		local debris=Instance.new("Debris")
5254
		debris.Parent=game
5255
	end
5256
	check()
5257
	game.Debris:AddItem(bullet,.05)
5258
	game.Debris:AddItem(bt2,.5)
5259
end
5260
5261
function onButton1Up(mouse)
5262
	down=false
5263
end
5264
5265
function onButton1Down(mouse)
5266
	h=sp.Parent:FindFirstChild("Humanoid")
5267
	if not enabled or reloading or down or h==nil then
5268
		return
5269
	end
5270
	if sp.Ammo.Value>0 and h.Health>0 then
5271
		--[[if sp.Ammo.Value<=0 then
5272
			if not reloading then
5273
				reload(mouse)
5274
			end
5275
			return
5276
		end]]
5277
		down=true
5278
		enabled=false
5279
		while down do
5280
			if sp.Ammo.Value<=0 then
5281
				break
5282
			end
5283
			if burst then
5284
				local startpoint=sp.Barrel.CFrame*BarrlePos
5285
				local mag=(mouse.Hit.p-startpoint).magnitude
5286
				local rndm=Vector3.new(math.random(-(script.Parent.Spread.Value/10)*mag,(script.Parent.Spread.Value/10)*mag),math.random(-(script.Parent.Spread.Value/10)*mag,(script.Parent.Spread.Value/10)*mag),math.random(-(script.Parent.Spread.Value/10)*mag,(script.Parent.Spread.Value/10)*mag))
5287
				fire(mouse.Hit.p+rndm)
5288
				sp.Ammo.Value=sp.Ammo.Value-1
5289
				if sp.Ammo.Value<=0 then
5290
					break
5291
				end
5292
				wait(.05)
5293
				local startpoint=sp.Barrel.CFrame*BarrlePos
5294
				local mag2=((mouse.Hit.p+rndm)-startpoint).magnitude
5295
				local rndm2=Vector3.new(math.random(-(.1/10)*mag2,(.1/10)*mag2),math.random(-(.1/10)*mag2,(.1/10)*mag2),math.random(-(.1/10)*mag2,(.1/10)*mag2))
5296
				fire(mouse.Hit.p+rndm+rndm2)
5297
				sp.Ammo.Value=sp.Ammo.Value-1
5298
				if sp.Ammo.Value<=0 then
5299
					break
5300
				end
5301
				wait(.05)
5302
				fire(mouse.Hit.p+rndm+rndm2+rndm2)
5303
				sp.Ammo.Value=sp.Ammo.Value-1
5304
			elseif shot then
5305
				sp.Ammo.Value=sp.Ammo.Value-1
5306
				local startpoint=sp.Barrel.CFrame*BarrlePos
5307
				local mag=(mouse.Hit.p-startpoint).magnitude
5308
				local rndm=Vector3.new(math.random(-(script.Parent.Spread.Value/10)*mag,(script.Parent.Spread.Value/10)*mag),math.random(-(script.Parent.Spread.Value/10)*mag,(script.Parent.Spread.Value/10)*mag),math.random(-(script.Parent.Spread.Value/10)*mag,(script.Parent.Spread.Value/10)*mag))
5309
				fire(mouse.Hit.p+rndm)
5310
				local mag2=((mouse.Hit.p+rndm)-startpoint).magnitude
5311
				local rndm2=Vector3.new(math.random(-(.2/10)*mag2,(.2/10)*mag2),math.random(-(.2/10)*mag2,(.2/10)*mag2),math.random(-(.2/10)*mag2,(.2/10)*mag2))
5312
				fire(mouse.Hit.p+rndm+rndm2)
5313
				local rndm3=Vector3.new(math.random(-(.2/10)*mag2,(.2/10)*mag2),math.random(-(.2/10)*mag2,(.2/10)*mag2),math.random(-(.2/10)*mag2,(.2/10)*mag2))
5314
				fire(mouse.Hit.p+rndm+rndm3)
5315
				local rndm4=Vector3.new(math.random(-(.2/10)*mag2,(.2/10)*mag2),math.random(-(.2/10)*mag2,(.2/10)*mag2),math.random(-(.2/10)*mag2,(.2/10)*mag2))
5316
				fire(mouse.Hit.p+rndm+rndm4)
5317
			else
5318
				local startpoint=sp.Barrel.CFrame*BarrlePos
5319
				local mag=(mouse.Hit.p-startpoint).magnitude
5320
				local rndm=Vector3.new(math.random(-(script.Parent.Spread.Value/10)*mag,(script.Parent.Spread.Value/10)*mag),math.random(-(script.Parent.Spread.Value/10)*mag,(script.Parent.Spread.Value/10)*mag),math.random(-(script.Parent.Spread.Value/10)*mag,(script.Parent.Spread.Value/10)*mag))
5321
				fire(mouse.Hit.p+rndm)
5322
				weld2.C1 = CFrame.new(-1.6, -0.5, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-70), -0.06)   --(forwards/backwards, 
5323
				wait(0.05)
5324
				weld2.C1 = CFrame.new(-1.3, -0.5, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-75), -0.04)   --(forwards/backwards, 
5325
				wait(0.05)
5326
				weld2.C1 = CFrame.new(-1, -0.5, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(-90), 0)   --(forwards/backwards, 
5327
			end
5328
			wait(Firerate)
5329
			if not automatic then
5330
				break
5331
			end
5332
		end	
5333
		enabled=true
5334
	else
5335
		sp.Handle.Trigger:Play()
5336
		sp.GripForward = Vector3.new(-0.243, -0.1, -0.97)
5337
		wait(0.1)
5338
		sp.GripForward = Vector3.new(-0.243, 0, -0.97)
5339
	end
5340
end
5341
5342
function onEquippedLocal(mouse)
5343
	if mouse==nil then
5344
		print("Mouse not found")
5345
		return 
5346
	end
5347
	mouse.Icon=Cursors[1]
5348
	mouse.KeyDown:connect(function(key) onKeyDown(key,mouse) end)
5349
	mouse.Button1Down:connect(function() onButton1Down(mouse) end)
5350
	mouse.Button1Up:connect(function() onButton1Up(mouse) end)
5351
	check()
5352
	equiped=true
5353
	if #Cursors>1 then
5354
		while equiped do
5355
			t=r.Stepped:wait()
5356
			local action=sp.Parent:FindFirstChild("Pose")
5357
			if action~=nil then
5358
				if sp.Parent.Pose.Value=="Standing" then
5359
					Spread=MinSpread
5360
				else
5361
					Spread=MinSpread+((4/10)*(MaxSpread-MinSpread))
5362
				end
5363
			else
5364
				Spread=MinSpread
5365
			end
5366
			if t-last<SpreadRate then
5367
				Spread=Spread+.1*(MaxSpread-MinSpread)
5368
			end
5369
			if t-last2<SpreadRate then
5370
				Spread=Spread+.1*(MaxSpread-MinSpread)
5371
			end
5372
			if t-last3<SpreadRate then
5373
				Spread=Spread+.1*(MaxSpread-MinSpread)
5374
			end
5375
			if t-last4<SpreadRate then
5376
				Spread=Spread+.1*(MaxSpread-MinSpread)
5377
			end
5378
			if t-last5<SpreadRate then
5379
				Spread=Spread+.1*(MaxSpread-MinSpread)
5380
			end
5381
			if t-last6<SpreadRate then
5382
				Spread=Spread+.1*(MaxSpread-MinSpread)
5383
			end
5384
			if not reloading then
5385
				local percent=(Spread-MinSpread)/(MaxSpread-MinSpread)
5386
				for i=0,#Cursors-1 do
5387
					if percent>(i/(#Cursors-1))-((1/(#Cursors-1))/2) and percent<(i/(#Cursors-1))+((1/(#Cursors-1))/2) then
5388
						mouse.Icon=Cursors[i+1]
5389
					end
5390
				end
5391
			end
5392
			wait(Firerate*.9)
5393
		end
5394
	end
5395
end
5396
function onUnequippedLocal(mouse)
5397
	equiped=false
5398
	reloading=false
5399
	sp.Neutral.Texture = "http://www.roblox.com/asset/?id=51962380"
5400
	sp.Friendly.Texture = "http://www.roblox.com/asset/?id=51962541"
5401
	sp.Enemy.Texture = "http://www.roblox.com/asset/?id=51962534"
5402
	sp.Spread = 0
5403
	sp.Parent.Humanoid.WalkSpeed = 16
5404
	ADS = 0
5405
	run = 0
5406
end
5407
sp.Equipped:connect(onEquippedLocal)
5408
sp.Unequipped:connect(onUnequippedLocal)
5409
check()
5410
end))
5411
Part88.Parent = Tool81
5412
Part88.Material = Enum.Material.Metal
5413
Part88.BrickColor = BrickColor.new("Black")
5414
Part88.Rotation = Vector3.new(-90, 0, 71.0699997)
5415
Part88.FormFactor = Enum.FormFactor.Custom
5416
Part88.Size = Vector3.new(0.25, 0.200000003, 0.25)
5417
Part88.CFrame = CFrame.new(13.3802023, 4.75810814, 0.172626004, 0.324368834, -0.94593066, -2.31046888e-05, 1.00436482e-05, -2.09812824e-05, 1, -0.94593066, -0.324368864, 2.69492193e-06)
5418
Part88.BottomSurface = Enum.SurfaceType.Smooth
5419
Part88.TopSurface = Enum.SurfaceType.Smooth
5420
Part88.Color = Color3.new(0.105882, 0.164706, 0.207843)
5421
Part88.Position = Vector3.new(13.3802023, 4.75810814, 0.172626004)
5422
Part88.Orientation = Vector3.new(-90, 71.0699997, 0)
5423
Part88.Color = Color3.new(0.105882, 0.164706, 0.207843)
5424
CylinderMesh89.Parent = Part88
5425
CylinderMesh89.Scale = Vector3.new(3, 0.75, 3)
5426
CylinderMesh89.Scale = Vector3.new(3, 0.75, 3)
5427
Part90.Name = "GlassPart"
5428
Part90.Parent = Tool81
5429
Part90.Material = Enum.Material.Glass
5430
Part90.BrickColor = BrickColor.new("Institutional white")
5431
Part90.Transparency = 0.5
5432
Part90.Rotation = Vector3.new(0, -37.8499985, 0)
5433
Part90.FormFactor = Enum.FormFactor.Custom
5434
Part90.Size = Vector3.new(0.400000006, 2, 0.200000003)
5435
Part90.CFrame = CFrame.new(11.3907623, 3.37725711, -0.318569005, 0.789619446, 3.87650289e-05, -0.61358273, -1.89694674e-05, 1, 3.87650289e-05, 0.61358273, -1.89694674e-05, 0.789619446)
5436
Part90.BottomSurface = Enum.SurfaceType.Smooth
5437
Part90.TopSurface = Enum.SurfaceType.Smooth
5438
Part90.Color = Color3.new(0.972549, 0.972549, 0.972549)
5439
Part90.Position = Vector3.new(11.3907623, 3.37725711, -0.318569005)
5440
Part90.Orientation = Vector3.new(0, -37.8499985, 0)
5441
Part90.Color = Color3.new(0.972549, 0.972549, 0.972549)
5442
BlockMesh91.Parent = Part90
5443
BlockMesh91.Offset = Vector3.new(0, 0, 0.0494999997)
5444
BlockMesh91.Scale = Vector3.new(1, 1, 0)
5445
BlockMesh91.Scale = Vector3.new(1, 1, 0)
5446
Part92.Name = "GlassPart"
5447
Part92.Parent = Tool81
5448
Part92.Material = Enum.Material.Glass
5449
Part92.BrickColor = BrickColor.new("Institutional white")
5450
Part92.Transparency = 0.5
5451
Part92.Rotation = Vector3.new(-180, -90, 0)
5452
Part92.FormFactor = Enum.FormFactor.Custom
5453
Part92.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
5454
Part92.CFrame = CFrame.new(14.1699362, 2.27702403, 0.649676979, -0.000118972122, -4.31590597e-05, -1, 2.79581602e-09, -1, 4.31590597e-05, -0.99999994, 2.33890907e-09, 0.00011897213)
5455
Part92.BottomSurface = Enum.SurfaceType.Smooth
5456
Part92.TopSurface = Enum.SurfaceType.Smooth
5457
Part92.Color = Color3.new(0.972549, 0.972549, 0.972549)
5458
Part92.Position = Vector3.new(14.1699362, 2.27702403, 0.649676979)
5459
Part92.Orientation = Vector3.new(0, -89.9899979, 180)
5460
Part92.Color = Color3.new(0.972549, 0.972549, 0.972549)
5461
SpecialMesh93.Parent = Part92
5462
SpecialMesh93.Scale = Vector3.new(0, 1, 1)
5463
SpecialMesh93.MeshType = Enum.MeshType.Wedge
5464
SpecialMesh93.Scale = Vector3.new(0, 1, 1)
5465
Part94.Parent = Tool81
5466
Part94.Material = Enum.Material.Metal
5467
Part94.BrickColor = BrickColor.new("Black")
5468
Part94.Rotation = Vector3.new(0, -28.3899994, 0)
5469
Part94.FormFactor = Enum.FormFactor.Custom
5470
Part94.Size = Vector3.new(0.5, 0.200000003, 0.200000003)
5471
Part94.CFrame = CFrame.new(11.9849997, 6.51584816, 0.0920599997, 0.879726708, 3.70690686e-05, -0.475472778, -2.21015525e-05, 1, 3.70690686e-05, 0.475472778, -2.21015525e-05, 0.879726708)
5472
Part94.BottomSurface = Enum.SurfaceType.Smooth
5473
Part94.TopSurface = Enum.SurfaceType.Smooth
5474
Part94.Color = Color3.new(0.105882, 0.164706, 0.207843)
5475
Part94.Position = Vector3.new(11.9849997, 6.51584816, 0.0920599997)
5476
Part94.Orientation = Vector3.new(0, -28.3899994, 0)
5477
Part94.Color = Color3.new(0.105882, 0.164706, 0.207843)
5478
BlockMesh95.Parent = Part94
5479
BlockMesh95.Scale = Vector3.new(1, 0.5, 0.5)
5480
BlockMesh95.Scale = Vector3.new(1, 0.5, 0.5)
5481
Part96.Parent = Tool81
5482
Part96.Material = Enum.Material.Metal
5483
Part96.BrickColor = BrickColor.new("Black")
5484
Part96.Rotation = Vector3.new(0, -37.8400002, 135)
5485
Part96.FormFactor = Enum.FormFactor.Custom
5486
Part96.Size = Vector3.new(0.200000003, 0.400000006, 0.200000003)
5487
Part96.CFrame = CFrame.new(11.2934103, 6.38909388, -0.394008994, -0.558394432, -0.558437765, -0.613467932, 0.707113028, -0.707100511, 3.85237654e-05, -0.433805048, -0.433769733, 0.789719641)
5488
Part96.BottomSurface = Enum.SurfaceType.Smooth
5489
Part96.TopSurface = Enum.SurfaceType.Smooth
5490
Part96.Color = Color3.new(0.105882, 0.164706, 0.207843)
5491
Part96.Position = Vector3.new(11.2934103, 6.38909388, -0.394008994)
5492
Part96.Orientation = Vector3.new(0, -37.8400002, 135)
5493
Part96.Color = Color3.new(0.105882, 0.164706, 0.207843)
5494
BlockMesh97.Parent = Part96
5495
BlockMesh97.Scale = Vector3.new(0.5, 1, 0.5)
5496
BlockMesh97.Scale = Vector3.new(0.5, 1, 0.5)
5497
Part98.Parent = Tool81
5498
Part98.Material = Enum.Material.Metal
5499
Part98.BrickColor = BrickColor.new("Black")
5500
Part98.Rotation = Vector3.new(0, -37.8499985, 0)
5501
Part98.FormFactor = Enum.FormFactor.Custom
5502
Part98.Size = Vector3.new(0.5, 0.200000003, 0.200000003)
5503
Part98.CFrame = CFrame.new(11.5745382, 6.51584816, -0.175518006, 0.789619446, 3.87650289e-05, -0.61358273, -1.89694674e-05, 1, 3.87650289e-05, 0.61358273, -1.89694674e-05, 0.789619446)
5504
Part98.BottomSurface = Enum.SurfaceType.Smooth
5505
Part98.TopSurface = Enum.SurfaceType.Smooth
5506
Part98.Color = Color3.new(0.105882, 0.164706, 0.207843)
5507
Part98.Position = Vector3.new(11.5745382, 6.51584816, -0.175518006)
5508
Part98.Orientation = Vector3.new(0, -37.8499985, 0)
5509
Part98.Color = Color3.new(0.105882, 0.164706, 0.207843)
5510
BlockMesh99.Parent = Part98
5511
BlockMesh99.Scale = Vector3.new(1, 0.5, 0.5)
5512
BlockMesh99.Scale = Vector3.new(1, 0.5, 0.5)
5513
Part100.Name = "GlassPart"
5514
Part100.Parent = Tool81
5515
Part100.Material = Enum.Material.Glass
5516
Part100.BrickColor = BrickColor.new("Institutional white")
5517
Part100.Transparency = 0.5
5518
Part100.Rotation = Vector3.new(0, -37.8499985, 0)
5519
Part100.FormFactor = Enum.FormFactor.Custom
5520
Part100.Size = Vector3.new(0.200000003, 0.223500013, 0.200000003)
5521
Part100.CFrame = CFrame.new(11.4696798, 6.3552742, -0.257061005, 0.789619446, 3.87650289e-05, -0.61358273, -1.89694674e-05, 1, 3.87650289e-05, 0.61358273, -1.89694674e-05, 0.789619446)
5522
Part100.BottomSurface = Enum.SurfaceType.Smooth
5523
Part100.TopSurface = Enum.SurfaceType.Smooth
5524
Part100.Color = Color3.new(0.972549, 0.972549, 0.972549)
5525
Part100.Position = Vector3.new(11.4696798, 6.3552742, -0.257061005)
5526
Part100.Orientation = Vector3.new(0, -37.8499985, 0)
5527
Part100.Color = Color3.new(0.972549, 0.972549, 0.972549)
5528
BlockMesh101.Parent = Part100
5529
BlockMesh101.Offset = Vector3.new(0, 0, 0.0494999997)
5530
BlockMesh101.Scale = Vector3.new(1, 1, 0)
5531
BlockMesh101.Scale = Vector3.new(1, 1, 0)
5532
Part102.Name = "GlassPart"
5533
Part102.Parent = Tool81
5534
Part102.Material = Enum.Material.Glass
5535
Part102.BrickColor = BrickColor.new("Institutional white")
5536
Part102.Transparency = 0.5
5537
Part102.Rotation = Vector3.new(90, 0.00999999978, 127.839996)
5538
Part102.FormFactor = Enum.FormFactor.Custom
5539
Part102.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
5540
Part102.CFrame = CFrame.new(11.2810202, 6.34355021, -0.340312988, -0.613507092, -0.789689183, 0.000104060433, -8.34418415e-07, -0.000131125649, -1, 0.789689183, -0.613507152, 7.97875909e-05)
5541
Part102.BottomSurface = Enum.SurfaceType.Smooth
5542
Part102.TopSurface = Enum.SurfaceType.Smooth
5543
Part102.Color = Color3.new(0.972549, 0.972549, 0.972549)
5544
Part102.Position = Vector3.new(11.2810202, 6.34355021, -0.340312988)
5545
Part102.Orientation = Vector3.new(90, -127.839996, 0)
5546
Part102.Color = Color3.new(0.972549, 0.972549, 0.972549)
5547
SpecialMesh103.Parent = Part102
5548
SpecialMesh103.Scale = Vector3.new(0, 1, 1)
5549
SpecialMesh103.MeshType = Enum.MeshType.Wedge
5550
SpecialMesh103.Scale = Vector3.new(0, 1, 1)
5551
Part104.Name = "GlassPart"
5552
Part104.Parent = Tool81
5553
Part104.Material = Enum.Material.Glass
5554
Part104.BrickColor = BrickColor.new("Institutional white")
5555
Part104.Transparency = 0.5
5556
Part104.Rotation = Vector3.new(0, -37.8499985, 0)
5557
Part104.FormFactor = Enum.FormFactor.Custom
5558
Part104.Size = Vector3.new(0.400000006, 1.06050003, 0.200000003)
5559
Part104.CFrame = CFrame.new(11.3907003, 5.71331215, -0.318569005, 0.789619446, 3.87650289e-05, -0.61358273, -1.89694674e-05, 1, 3.87650289e-05, 0.61358273, -1.89694674e-05, 0.789619446)
5560
Part104.BottomSurface = Enum.SurfaceType.Smooth
5561
Part104.TopSurface = Enum.SurfaceType.Smooth
5562
Part104.Color = Color3.new(0.972549, 0.972549, 0.972549)
5563
Part104.Position = Vector3.new(11.3907003, 5.71331215, -0.318569005)
5564
Part104.Orientation = Vector3.new(0, -37.8499985, 0)
5565
Part104.Color = Color3.new(0.972549, 0.972549, 0.972549)
5566
BlockMesh105.Parent = Part104
5567
BlockMesh105.Offset = Vector3.new(0, 0, 0.0494999997)
5568
BlockMesh105.Scale = Vector3.new(1, 1, 0)
5569
BlockMesh105.Scale = Vector3.new(1, 1, 0)
5570
Part106.Name = "GlassPart"
5571
Part106.Parent = Tool81
5572
Part106.Material = Enum.Material.Glass
5573
Part106.BrickColor = BrickColor.new("Institutional white")
5574
Part106.Transparency = 0.5
5575
Part106.Rotation = Vector3.new(0, -28.3899994, 0)
5576
Part106.FormFactor = Enum.FormFactor.Custom
5577
Part106.Size = Vector3.new(0.5, 1.29999995, 0.200000003)
5578
Part106.CFrame = CFrame.new(11.761672, 5.8180418, -0.0815239996, 0.879726708, 3.70690686e-05, -0.475472778, -2.21015525e-05, 1, 3.70690686e-05, 0.475472778, -2.21015525e-05, 0.879726708)
5579
Part106.BottomSurface = Enum.SurfaceType.Smooth
5580
Part106.TopSurface = Enum.SurfaceType.Smooth
5581
Part106.Color = Color3.new(0.972549, 0.972549, 0.972549)
5582
Part106.Position = Vector3.new(11.761672, 5.8180418, -0.0815239996)
5583
Part106.Orientation = Vector3.new(0, -28.3899994, 0)
5584
Part106.Color = Color3.new(0.972549, 0.972549, 0.972549)
5585
BlockMesh107.Parent = Part106
5586
BlockMesh107.Offset = Vector3.new(0, 0, 0.0494999997)
5587
BlockMesh107.Scale = Vector3.new(1, 1, 0)
5588
BlockMesh107.Scale = Vector3.new(1, 1, 0)
5589
Part108.Parent = Tool81
5590
Part108.Material = Enum.Material.Metal
5591
Part108.BrickColor = BrickColor.new("Black")
5592
Part108.Rotation = Vector3.new(0, -9.46000004, 0)
5593
Part108.FormFactor = Enum.FormFactor.Custom
5594
Part108.Size = Vector3.new(0.5, 0.200000003, 0.200000003)
5595
Part108.CFrame = CFrame.new(13.3487082, 6.51590919, 0.559585989, 0.986395717, 3.29302056e-05, -0.164386213, -2.78963325e-05, 1, 3.29302056e-05, 0.164386213, -2.78963325e-05, 0.986395717)
5596
Part108.BottomSurface = Enum.SurfaceType.Smooth
5597
Part108.TopSurface = Enum.SurfaceType.Smooth
5598
Part108.Color = Color3.new(0.105882, 0.164706, 0.207843)
5599
Part108.Position = Vector3.new(13.3487082, 6.51590919, 0.559585989)
5600
Part108.Orientation = Vector3.new(0, -9.46000004, 0)
5601
Part108.Color = Color3.new(0.105882, 0.164706, 0.207843)
5602
BlockMesh109.Parent = Part108
5603
BlockMesh109.Scale = Vector3.new(1, 0.5, 0.5)
5604
BlockMesh109.Scale = Vector3.new(1, 0.5, 0.5)
5605
Part110.Parent = Tool81
5606
Part110.Material = Enum.Material.Metal
5607
Part110.BrickColor = BrickColor.new("Black")
5608
Part110.FormFactor = Enum.FormFactor.Custom
5609
Part110.Size = Vector3.new(0.5, 0.200000003, 0.200000003)
5610
Part110.CFrame = CFrame.new(13.8371124, 6.51590919, 0.600117028, 1, 3.05171125e-05, -3.05161811e-05, -3.05161811e-05, 1, 3.05171125e-05, 3.05171125e-05, -3.05161811e-05, 1)
5611
Part110.BottomSurface = Enum.SurfaceType.Smooth
5612
Part110.TopSurface = Enum.SurfaceType.Smooth
5613
Part110.Color = Color3.new(0.105882, 0.164706, 0.207843)
5614
Part110.Position = Vector3.new(13.8371124, 6.51590919, 0.600117028)
5615
Part110.Color = Color3.new(0.105882, 0.164706, 0.207843)
5616
BlockMesh111.Parent = Part110
5617
BlockMesh111.Scale = Vector3.new(1, 0.5, 0.5)
5618
BlockMesh111.Scale = Vector3.new(1, 0.5, 0.5)
5619
Part112.Parent = Tool81
5620
Part112.Material = Enum.Material.Metal
5621
Part112.BrickColor = BrickColor.new("Black")
5622
Part112.Rotation = Vector3.new(0, -37.8499985, 0)
5623
Part112.FormFactor = Enum.FormFactor.Custom
5624
Part112.Size = Vector3.new(0.200000003, 1.10000002, 0.200000003)
5625
Part112.CFrame = CFrame.new(11.1933136, 5.73304176, -0.471935004, 0.789619446, 3.87650289e-05, -0.61358273, -1.89694674e-05, 1, 3.87650289e-05, 0.61358273, -1.89694674e-05, 0.789619446)
5626
Part112.BottomSurface = Enum.SurfaceType.Smooth
5627
Part112.TopSurface = Enum.SurfaceType.Smooth
5628
Part112.Color = Color3.new(0.105882, 0.164706, 0.207843)
5629
Part112.Position = Vector3.new(11.1933136, 5.73304176, -0.471935004)
5630
Part112.Orientation = Vector3.new(0, -37.8499985, 0)
5631
Part112.Color = Color3.new(0.105882, 0.164706, 0.207843)
5632
BlockMesh113.Parent = Part112
5633
BlockMesh113.Scale = Vector3.new(0.5, 1, 0.5)
5634
BlockMesh113.Scale = Vector3.new(0.5, 1, 0.5)
5635
Part114.Parent = Tool81
5636
Part114.Material = Enum.Material.Metal
5637
Part114.BrickColor = BrickColor.new("Black")
5638
Part114.Rotation = Vector3.new(0, -18.9300003, 0)
5639
Part114.FormFactor = Enum.FormFactor.Custom
5640
Part114.Size = Vector3.new(0.966000438, 0.200000003, 0.200000003)
5641
Part114.CFrame = CFrame.new(12.6531525, 6.51590919, 0.364033014, 0.945934772, 3.51197777e-05, -0.324356169, -2.50846242e-05, 1, 3.51197777e-05, 0.324356169, -2.50846242e-05, 0.945934772)
5642
Part114.BottomSurface = Enum.SurfaceType.Smooth
5643
Part114.TopSurface = Enum.SurfaceType.Smooth
5644
Part114.Color = Color3.new(0.105882, 0.164706, 0.207843)
5645
Part114.Position = Vector3.new(12.6531525, 6.51590919, 0.364033014)
5646
Part114.Orientation = Vector3.new(0, -18.9300003, 0)
5647
Part114.Color = Color3.new(0.105882, 0.164706, 0.207843)
5648
BlockMesh115.Parent = Part114
5649
BlockMesh115.Scale = Vector3.new(1, 0.5, 0.5)
5650
BlockMesh115.Scale = Vector3.new(1, 0.5, 0.5)
5651
Part116.Name = "GlassPart"
5652
Part116.Parent = Tool81
5653
Part116.Material = Enum.Material.Glass
5654
Part116.BrickColor = BrickColor.new("Institutional white")
5655
Part116.Transparency = 0.5
5656
Part116.Rotation = Vector3.new(0, -90, 0)
5657
Part116.FormFactor = Enum.FormFactor.Custom
5658
Part116.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
5659
Part116.CFrame = CFrame.new(14.1699362, 6.34361982, 0.64991802, -3.26636837e-05, 4.31581502e-05, -1, 9.29513244e-10, 1, 4.31581502e-05, 0.99999994, 4.80190998e-10, -3.26636873e-05)
5660
Part116.BottomSurface = Enum.SurfaceType.Smooth
5661
Part116.TopSurface = Enum.SurfaceType.Smooth
5662
Part116.Color = Color3.new(0.972549, 0.972549, 0.972549)
5663
Part116.Position = Vector3.new(14.1699362, 6.34361982, 0.64991802)
5664
Part116.Orientation = Vector3.new(0, -90, 0)
5665
Part116.Color = Color3.new(0.972549, 0.972549, 0.972549)
5666
SpecialMesh117.Parent = Part116
5667
SpecialMesh117.Scale = Vector3.new(0, 1, 1)
5668
SpecialMesh117.MeshType = Enum.MeshType.Wedge
5669
SpecialMesh117.Scale = Vector3.new(0, 1, 1)
5670
Part118.Name = "GlassPart"
5671
Part118.Parent = Tool81
5672
Part118.Material = Enum.Material.Glass
5673
Part118.BrickColor = BrickColor.new("Institutional white")
5674
Part118.Transparency = 0.5
5675
Part118.Rotation = Vector3.new(0, -18.9200001, 0)
5676
Part118.FormFactor = Enum.FormFactor.Custom
5677
Part118.Size = Vector3.new(1.5, 1.29999995, 0.200000003)
5678
Part118.CFrame = CFrame.new(12.6835442, 5.81983423, 0.277363002, 0.945954859, -3.51188464e-05, -0.324295938, 2.50855555e-05, 1, -3.51188464e-05, 0.324295938, 2.50855555e-05, 0.945954859)
5679
Part118.BottomSurface = Enum.SurfaceType.Smooth
5680
Part118.TopSurface = Enum.SurfaceType.Smooth
5681
Part118.Color = Color3.new(0.972549, 0.972549, 0.972549)
5682
Part118.Position = Vector3.new(12.6835442, 5.81983423, 0.277363002)
5683
Part118.Orientation = Vector3.new(0, -18.9200001, 0)
5684
Part118.Color = Color3.new(0.972549, 0.972549, 0.972549)
5685
BlockMesh119.Parent = Part118
5686
BlockMesh119.Offset = Vector3.new(0, 0, 0.0494999997)
5687
BlockMesh119.Scale = Vector3.new(1, 1, 0)
5688
BlockMesh119.Scale = Vector3.new(1, 1, 0)
5689
Part120.Parent = Tool81
5690
Part120.Material = Enum.Material.Metal
5691
Part120.BrickColor = BrickColor.new("Black")
5692
Part120.Rotation = Vector3.new(0, 0, -135)
5693
Part120.FormFactor = Enum.FormFactor.Custom
5694
Part120.Size = Vector3.new(0.200000003, 0.400000006, 0.200000003)
5695
Part120.CFrame = CFrame.new(14.1931915, 6.38920021, 0.600117028, -0.707149565, 0.707063973, 7.29076783e-05, -0.707063973, -0.707149565, 6.32290612e-05, 9.62636259e-05, -6.83798817e-06, 1)
5696
Part120.BottomSurface = Enum.SurfaceType.Smooth
5697
Part120.TopSurface = Enum.SurfaceType.Smooth
5698
Part120.Color = Color3.new(0.105882, 0.164706, 0.207843)
5699
Part120.Position = Vector3.new(14.1931915, 6.38920021, 0.600117028)
5700
Part120.Orientation = Vector3.new(0, 0, -135)
5701
Part120.Color = Color3.new(0.105882, 0.164706, 0.207843)
5702
BlockMesh121.Parent = Part120
5703
BlockMesh121.Scale = Vector3.new(0.5, 1, 0.5)
5704
BlockMesh121.Scale = Vector3.new(0.5, 1, 0.5)
5705
Part122.Name = "GlassPart"
5706
Part122.Parent = Tool81
5707
Part122.Material = Enum.Material.Glass
5708
Part122.BrickColor = BrickColor.new("Institutional white")
5709
Part122.Transparency = 0.5
5710
Part122.FormFactor = Enum.FormFactor.Custom
5711
Part122.Size = Vector3.new(0.200000003, 0.223500013, 0.200000003)
5712
Part122.CFrame = CFrame.new(13.969986, 6.35533524, 0.600117028, 1, 3.05171125e-05, -3.05161811e-05, -3.05161811e-05, 1, 3.05171125e-05, 3.05171125e-05, -3.05161811e-05, 1)
5713
Part122.BottomSurface = Enum.SurfaceType.Smooth
5714
Part122.TopSurface = Enum.SurfaceType.Smooth
5715
Part122.Color = Color3.new(0.972549, 0.972549, 0.972549)
5716
Part122.Position = Vector3.new(13.969986, 6.35533524, 0.600117028)
5717
Part122.Color = Color3.new(0.972549, 0.972549, 0.972549)
5718
BlockMesh123.Parent = Part122
5719
BlockMesh123.Offset = Vector3.new(0, 0, 0.0494999997)
5720
BlockMesh123.Scale = Vector3.new(1, 1, 0)
5721
BlockMesh123.Scale = Vector3.new(1, 1, 0)
5722
Part124.Name = "GlassPart"
5723
Part124.Parent = Tool81
5724
Part124.Material = Enum.Material.Glass
5725
Part124.BrickColor = BrickColor.new("Institutional white")
5726
Part124.Transparency = 0.5
5727
Part124.FormFactor = Enum.FormFactor.Custom
5728
Part124.Size = Vector3.new(0.400000006, 1.06050014, 0.200000003)
5729
Part124.CFrame = CFrame.new(14.0699615, 5.71336222, 0.600117028, 1, 3.05171125e-05, -3.05161811e-05, -3.05161811e-05, 1, 3.05171125e-05, 3.05171125e-05, -3.05161811e-05, 1)
5730
Part124.BottomSurface = Enum.SurfaceType.Smooth
5731
Part124.TopSurface = Enum.SurfaceType.Smooth
5732
Part124.Color = Color3.new(0.972549, 0.972549, 0.972549)
5733
Part124.Position = Vector3.new(14.0699615, 5.71336222, 0.600117028)
5734
Part124.Color = Color3.new(0.972549, 0.972549, 0.972549)
5735
BlockMesh125.Parent = Part124
5736
BlockMesh125.Offset = Vector3.new(0, 0, 0.0494999997)
5737
BlockMesh125.Scale = Vector3.new(1, 1, 0)
5738
BlockMesh125.Scale = Vector3.new(1, 1, 0)
5739
Part126.Name = "Barrel"
5740
Part126.Parent = Tool81
5741
Part126.Material = Enum.Material.Metal
5742
Part126.BrickColor = BrickColor.new("Black")
5743
Part126.Rotation = Vector3.new(0, -18.9200001, 0)
5744
Part126.FormFactor = Enum.FormFactor.Custom
5745
Part126.Size = Vector3.new(1.5, 0.850000024, 0.200000003)
5746
Part126.CFrame = CFrame.new(12.6835442, 4.75803518, 0.277363002, 0.945954859, -3.51188464e-05, -0.324295938, 2.50855555e-05, 1, -3.51188464e-05, 0.324295938, 2.50855555e-05, 0.945954859)
5747
Part126.BottomSurface = Enum.SurfaceType.Smooth
5748
Part126.TopSurface = Enum.SurfaceType.Smooth
5749
Part126.Color = Color3.new(0.105882, 0.164706, 0.207843)
5750
Part126.Position = Vector3.new(12.6835442, 4.75803518, 0.277363002)
5751
Part126.Orientation = Vector3.new(0, -18.9200001, 0)
5752
Part126.Color = Color3.new(0.105882, 0.164706, 0.207843)
5753
BlockMesh127.Parent = Part126
5754
BlockMesh127.Scale = Vector3.new(1, 1, 0.5)
5755
BlockMesh127.Scale = Vector3.new(1, 1, 0.5)
5756
Decal128.Parent = Part126
5757
Decal128.Texture = "http://www.roblox.com/asset/?id=156639788"
5758
Decal128.Face = Enum.NormalId.Back
5759
Part129.Parent = Tool81
5760
Part129.Material = Enum.Material.Metal
5761
Part129.BrickColor = BrickColor.new("Black")
5762
Part129.Rotation = Vector3.new(0, -28.3899994, 0)
5763
Part129.FormFactor = Enum.FormFactor.Custom
5764
Part129.Size = Vector3.new(0.5, 0.850000024, 0.200000003)
5765
Part129.CFrame = CFrame.new(11.761734, 4.75803518, -0.0815239996, 0.879726708, 3.70690686e-05, -0.475472778, -2.21015525e-05, 1, 3.70690686e-05, 0.475472778, -2.21015525e-05, 0.879726708)
5766
Part129.BottomSurface = Enum.SurfaceType.Smooth
5767
Part129.TopSurface = Enum.SurfaceType.Smooth
5768
Part129.Color = Color3.new(0.105882, 0.164706, 0.207843)
5769
Part129.Position = Vector3.new(11.761734, 4.75803518, -0.0815239996)
5770
Part129.Orientation = Vector3.new(0, -28.3899994, 0)
5771
Part129.Color = Color3.new(0.105882, 0.164706, 0.207843)
5772
BlockMesh130.Parent = Part129
5773
BlockMesh130.Scale = Vector3.new(1, 1, 0.5)
5774
BlockMesh130.Scale = Vector3.new(1, 1, 0.5)
5775
Part131.Parent = Tool81
5776
Part131.Material = Enum.Material.Metal
5777
Part131.BrickColor = BrickColor.new("Black")
5778
Part131.Rotation = Vector3.new(-90, 0, 71.0699997)
5779
Part131.FormFactor = Enum.FormFactor.Custom
5780
Part131.Size = Vector3.new(0.25, 0.200000003, 0.25)
5781
Part131.CFrame = CFrame.new(12.1975861, 4.75803518, -0.232890993, 0.324368834, -0.94593066, -2.31046888e-05, 1.00436482e-05, -2.09812824e-05, 1, -0.94593066, -0.324368864, 2.69492193e-06)
5782
Part131.BottomSurface = Enum.SurfaceType.Smooth
5783
Part131.TopSurface = Enum.SurfaceType.Smooth
5784
Part131.Color = Color3.new(0.105882, 0.164706, 0.207843)
5785
Part131.Position = Vector3.new(12.1975861, 4.75803518, -0.232890993)
5786
Part131.Orientation = Vector3.new(-90, 71.0699997, 0)
5787
Part131.Color = Color3.new(0.105882, 0.164706, 0.207843)
5788
CylinderMesh132.Parent = Part131
5789
CylinderMesh132.Scale = Vector3.new(3, 0.75, 3)
5790
CylinderMesh132.Scale = Vector3.new(3, 0.75, 3)
5791
Part133.Parent = Tool81
5792
Part133.Material = Enum.Material.Metal
5793
Part133.BrickColor = BrickColor.new("Black")
5794
Part133.Rotation = Vector3.new(0, -37.8499985, 0)
5795
Part133.FormFactor = Enum.FormFactor.Custom
5796
Part133.Size = Vector3.new(0.5, 0.850000024, 0.200000003)
5797
Part133.CFrame = CFrame.new(11.3512716, 4.75803518, -0.34910199, 0.789619446, 3.87650289e-05, -0.61358273, -1.89694674e-05, 1, 3.87650289e-05, 0.61358273, -1.89694674e-05, 0.789619446)
5798
Part133.BottomSurface = Enum.SurfaceType.Smooth
5799
Part133.TopSurface = Enum.SurfaceType.Smooth
5800
Part133.Color = Color3.new(0.105882, 0.164706, 0.207843)
5801
Part133.Position = Vector3.new(11.3512716, 4.75803518, -0.34910199)
5802
Part133.Orientation = Vector3.new(0, -37.8499985, 0)
5803
Part133.Color = Color3.new(0.105882, 0.164706, 0.207843)
5804
BlockMesh134.Parent = Part133
5805
BlockMesh134.Scale = Vector3.new(1, 1, 0.5)
5806
BlockMesh134.Scale = Vector3.new(1, 1, 0.5)
5807
Part135.Name = "GlassPart"
5808
Part135.Parent = Tool81
5809
Part135.Material = Enum.Material.Glass
5810
Part135.BrickColor = BrickColor.new("Institutional white")
5811
Part135.Transparency = 0.5
5812
Part135.Rotation = Vector3.new(0, -9.46000004, 0)
5813
Part135.FormFactor = Enum.FormFactor.Custom
5814
Part135.Size = Vector3.new(0.5, 1.29999995, 0.200000003)
5815
Part135.CFrame = CFrame.new(13.6316061, 5.81809902, 0.559585989, 0.986395717, 3.29302056e-05, -0.164386213, -2.78963325e-05, 1, 3.29302056e-05, 0.164386213, -2.78963325e-05, 0.986395717)
5816
Part135.BottomSurface = Enum.SurfaceType.Smooth
5817
Part135.TopSurface = Enum.SurfaceType.Smooth
5818
Part135.Color = Color3.new(0.972549, 0.972549, 0.972549)
5819
Part135.Position = Vector3.new(13.6316061, 5.81809902, 0.559585989)
5820
Part135.Orientation = Vector3.new(0, -9.46000004, 0)
5821
Part135.Color = Color3.new(0.972549, 0.972549, 0.972549)
5822
BlockMesh136.Parent = Part135
5823
BlockMesh136.Offset = Vector3.new(0, 0, 0.0494999997)
5824
BlockMesh136.Scale = Vector3.new(1, 1, 0)
5825
BlockMesh136.Scale = Vector3.new(1, 1, 0)
5826
Part137.Parent = Tool81
5827
Part137.Material = Enum.Material.Metal
5828
Part137.BrickColor = BrickColor.new("Black")
5829
Part137.FormFactor = Enum.FormFactor.Custom
5830
Part137.Size = Vector3.new(0.200000003, 1.10000002, 0.200000003)
5831
Part137.CFrame = CFrame.new(14.3199615, 5.73314905, 0.600117028, 1, 3.05171125e-05, -3.05161811e-05, -3.05161811e-05, 1, 3.05171125e-05, 3.05171125e-05, -3.05161811e-05, 1)
5832
Part137.BottomSurface = Enum.SurfaceType.Smooth
5833
Part137.TopSurface = Enum.SurfaceType.Smooth
5834
Part137.Color = Color3.new(0.105882, 0.164706, 0.207843)
5835
Part137.Position = Vector3.new(14.3199615, 5.73314905, 0.600117028)
5836
Part137.Color = Color3.new(0.105882, 0.164706, 0.207843)
5837
BlockMesh138.Parent = Part137
5838
BlockMesh138.Scale = Vector3.new(0.5, 1, 0.5)
5839
BlockMesh138.Scale = Vector3.new(0.5, 1, 0.5)
5840
Part139.Parent = Tool81
5841
Part139.Material = Enum.Material.Metal
5842
Part139.BrickColor = BrickColor.new("Black")
5843
Part139.Rotation = Vector3.new(0, -9.46000004, 0)
5844
Part139.FormFactor = Enum.FormFactor.Custom
5845
Part139.Size = Vector3.new(0.5, 0.850000024, 0.200000003)
5846
Part139.CFrame = CFrame.new(13.6316061, 4.75810814, 0.559585989, 0.986395717, 3.29302056e-05, -0.164386213, -2.78963325e-05, 1, 3.29302056e-05, 0.164386213, -2.78963325e-05, 0.986395717)
5847
Part139.BottomSurface = Enum.SurfaceType.Smooth
5848
Part139.TopSurface = Enum.SurfaceType.Smooth
5849
Part139.Color = Color3.new(0.105882, 0.164706, 0.207843)
5850
Part139.Position = Vector3.new(13.6316061, 4.75810814, 0.559585989)
5851
Part139.Orientation = Vector3.new(0, -9.46000004, 0)
5852
Part139.Color = Color3.new(0.105882, 0.164706, 0.207843)
5853
BlockMesh140.Parent = Part139
5854
BlockMesh140.Scale = Vector3.new(1, 1, 0.5)
5855
BlockMesh140.Scale = Vector3.new(1, 1, 0.5)
5856
Part141.Parent = Tool81
5857
Part141.Material = Enum.Material.Metal
5858
Part141.BrickColor = BrickColor.new("Black")
5859
Part141.Rotation = Vector3.new(0, -37.8499985, 0)
5860
Part141.FormFactor = Enum.FormFactor.Custom
5861
Part141.Size = Vector3.new(0.200000003, 2, 0.200000003)
5862
Part141.CFrame = CFrame.new(11.1933403, 3.3330729, -0.471935004, 0.789619446, 3.87650289e-05, -0.61358273, -1.89694674e-05, 1, 3.87650289e-05, 0.61358273, -1.89694674e-05, 0.789619446)
5863
Part141.BottomSurface = Enum.SurfaceType.Smooth
5864
Part141.TopSurface = Enum.SurfaceType.Smooth
5865
Part141.Color = Color3.new(0.105882, 0.164706, 0.207843)
5866
Part141.Position = Vector3.new(11.1933403, 3.3330729, -0.471935004)
5867
Part141.Orientation = Vector3.new(0, -37.8499985, 0)
5868
Part141.Color = Color3.new(0.105882, 0.164706, 0.207843)
5869
BlockMesh142.Parent = Part141
5870
BlockMesh142.Scale = Vector3.new(0.5, 1, 0.5)
5871
BlockMesh142.Scale = Vector3.new(0.5, 1, 0.5)
5872
Part143.Name = "GlassPart"
5873
Part143.Parent = Tool81
5874
Part143.Material = Enum.Material.Glass
5875
Part143.BrickColor = BrickColor.new("Institutional white")
5876
Part143.Transparency = 0.5
5877
Part143.FormFactor = Enum.FormFactor.Custom
5878
Part143.Size = Vector3.new(0.200000003, 0.223500013, 0.200000003)
5879
Part143.CFrame = CFrame.new(13.9701042, 2.26522803, 0.599873006, 1, 3.05171125e-05, -3.05161811e-05, -3.05161811e-05, 1, 3.05171125e-05, 3.05171125e-05, -3.05161811e-05, 1)
5880
Part143.BottomSurface = Enum.SurfaceType.Smooth
5881
Part143.TopSurface = Enum.SurfaceType.Smooth
5882
Part143.Color = Color3.new(0.972549, 0.972549, 0.972549)
5883
Part143.Position = Vector3.new(13.9701042, 2.26522803, 0.599873006)
5884
Part143.Color = Color3.new(0.972549, 0.972549, 0.972549)
5885
BlockMesh144.Parent = Part143
5886
BlockMesh144.Offset = Vector3.new(0, 0, 0.0494999997)
5887
BlockMesh144.Scale = Vector3.new(1, 1, 0)
5888
BlockMesh144.Scale = Vector3.new(1, 1, 0)
5889
Part145.Parent = Tool81
5890
Part145.Material = Enum.Material.Metal
5891
Part145.BrickColor = BrickColor.new("Black")
5892
Part145.Rotation = Vector3.new(90.0099945, -45.0099983, 90)
5893
Part145.FormFactor = Enum.FormFactor.Custom
5894
Part145.Size = Vector3.new(0.200000003, 0.200000003, 0.400000006)
5895
Part145.CFrame = CFrame.new(14.1933136, 2.22689891, 0.599873006, -1.09672546e-05, -0.707021356, -0.707198203, -9.6231699e-05, 0.707193971, -0.707021356, 1.00000417, 6.32703304e-05, -7.7009201e-05)
5896
Part145.BottomSurface = Enum.SurfaceType.Smooth
5897
Part145.TopSurface = Enum.SurfaceType.Smooth
5898
Part145.Color = Color3.new(0.105882, 0.164706, 0.207843)
5899
Part145.Position = Vector3.new(14.1933136, 2.22689891, 0.599873006)
5900
Part145.Orientation = Vector3.new(44.9899979, -90.0099945, -0.00999999978)
5901
Part145.Color = Color3.new(0.105882, 0.164706, 0.207843)
5902
BlockMesh146.Parent = Part145
5903
BlockMesh146.Scale = Vector3.new(0.5, 0.5, 1)
5904
BlockMesh146.Scale = Vector3.new(0.5, 0.5, 1)
5905
Part147.Parent = Tool81
5906
Part147.Material = Enum.Material.Metal
5907
Part147.BrickColor = BrickColor.new("Black")
5908
Part147.FormFactor = Enum.FormFactor.Custom
5909
Part147.Size = Vector3.new(0.5, 0.200000003, 0.200000003)
5910
Part147.CFrame = CFrame.new(13.8372335, 2.10008693, 0.599873006, 1, 3.05171125e-05, -3.05161811e-05, -3.05161811e-05, 1, 3.05171125e-05, 3.05171125e-05, -3.05161811e-05, 1)
5911
Part147.BottomSurface = Enum.SurfaceType.Smooth
5912
Part147.TopSurface = Enum.SurfaceType.Smooth
5913
Part147.Color = Color3.new(0.105882, 0.164706, 0.207843)
5914
Part147.Position = Vector3.new(13.8372335, 2.10008693, 0.599873006)
5915
Part147.Color = Color3.new(0.105882, 0.164706, 0.207843)
5916
BlockMesh148.Parent = Part147
5917
BlockMesh148.Scale = Vector3.new(1, 0.5, 0.5)
5918
BlockMesh148.Scale = Vector3.new(1, 0.5, 0.5)
5919
Part149.Parent = Tool81
5920
Part149.Material = Enum.Material.Metal
5921
Part149.BrickColor = BrickColor.new("Black")
5922
Part149.Rotation = Vector3.new(0, -18.9300003, 0)
5923
Part149.FormFactor = Enum.FormFactor.Custom
5924
Part149.Size = Vector3.new(0.965000272, 0.200000003, 0.200000003)
5925
Part149.CFrame = CFrame.new(12.6539459, 2.10004497, 0.364033014, 0.945934772, 3.51197777e-05, -0.324356169, -2.50846242e-05, 1, 3.51197777e-05, 0.324356169, -2.50846242e-05, 0.945934772)
5926
Part149.BottomSurface = Enum.SurfaceType.Smooth
5927
Part149.TopSurface = Enum.SurfaceType.Smooth
5928
Part149.Color = Color3.new(0.105882, 0.164706, 0.207843)
5929
Part149.Position = Vector3.new(12.6539459, 2.10004497, 0.364033014)
5930
Part149.Orientation = Vector3.new(0, -18.9300003, 0)
5931
Part149.Color = Color3.new(0.105882, 0.164706, 0.207843)
5932
BlockMesh150.Parent = Part149
5933
BlockMesh150.Scale = Vector3.new(1, 0.5, 0.5)
5934
BlockMesh150.Scale = Vector3.new(1, 0.5, 0.5)
5935
Part151.Name = "GlassPart"
5936
Part151.Parent = Tool81
5937
Part151.Material = Enum.Material.Glass
5938
Part151.BrickColor = BrickColor.new("Institutional white")
5939
Part151.Transparency = 0.5
5940
Part151.Rotation = Vector3.new(0, -9.46000004, 0)
5941
Part151.FormFactor = Enum.FormFactor.Custom
5942
Part151.Size = Vector3.new(0.5, 2.20000005, 0.200000003)
5943
Part151.CFrame = CFrame.new(13.6316643, 3.24810004, 0.559585989, 0.986395717, 3.29302056e-05, -0.164386213, -2.78963325e-05, 1, 3.29302056e-05, 0.164386213, -2.78963325e-05, 0.986395717)
5944
Part151.BottomSurface = Enum.SurfaceType.Smooth
5945
Part151.TopSurface = Enum.SurfaceType.Smooth
5946
Part151.Color = Color3.new(0.972549, 0.972549, 0.972549)
5947
Part151.Position = Vector3.new(13.6316643, 3.24810004, 0.559585989)
5948
Part151.Orientation = Vector3.new(0, -9.46000004, 0)
5949
Part151.Color = Color3.new(0.972549, 0.972549, 0.972549)
5950
BlockMesh152.Parent = Part151
5951
BlockMesh152.Offset = Vector3.new(0, 0, 0.0494999997)
5952
BlockMesh152.Scale = Vector3.new(1, 1, 0)
5953
BlockMesh152.Scale = Vector3.new(1, 1, 0)
5954
Part153.Name = "GlassPart"
5955
Part153.Parent = Tool81
5956
Part153.Material = Enum.Material.Glass
5957
Part153.BrickColor = BrickColor.new("Institutional white")
5958
Part153.Transparency = 0.5
5959
Part153.Rotation = Vector3.new(0, -37.8499985, 0)
5960
Part153.FormFactor = Enum.FormFactor.Custom
5961
Part153.Size = Vector3.new(0.200000003, 0.223500013, 0.200000003)
5962
Part153.CFrame = CFrame.new(11.4698019, 2.26519895, -0.257304996, 0.789619446, 3.87650289e-05, -0.61358273, -1.89694674e-05, 1, 3.87650289e-05, 0.61358273, -1.89694674e-05, 0.789619446)
5963
Part153.BottomSurface = Enum.SurfaceType.Smooth
5964
Part153.TopSurface = Enum.SurfaceType.Smooth
5965
Part153.Color = Color3.new(0.972549, 0.972549, 0.972549)
5966
Part153.Position = Vector3.new(11.4698019, 2.26519895, -0.257304996)
5967
Part153.Orientation = Vector3.new(0, -37.8499985, 0)
5968
Part153.Color = Color3.new(0.972549, 0.972549, 0.972549)
5969
BlockMesh154.Parent = Part153
5970
BlockMesh154.Offset = Vector3.new(0, 0, 0.0494999997)
5971
BlockMesh154.Scale = Vector3.new(1, 1, 0)
5972
BlockMesh154.Scale = Vector3.new(1, 1, 0)
5973
Part155.Parent = Tool81
5974
Part155.Material = Enum.Material.Metal
5975
Part155.BrickColor = BrickColor.new("Black")
5976
Part155.Rotation = Vector3.new(0, -37.8499985, 0)
5977
Part155.FormFactor = Enum.FormFactor.Custom
5978
Part155.Size = Vector3.new(0.5, 0.200000003, 0.200000003)
5979
Part155.CFrame = CFrame.new(11.5747223, 2.10004497, -0.175761998, 0.789619446, 3.87650289e-05, -0.61358273, -1.89694674e-05, 1, 3.87650289e-05, 0.61358273, -1.89694674e-05, 0.789619446)
5980
Part155.BottomSurface = Enum.SurfaceType.Smooth
5981
Part155.TopSurface = Enum.SurfaceType.Smooth
5982
Part155.Color = Color3.new(0.105882, 0.164706, 0.207843)
5983
Part155.Position = Vector3.new(11.5747223, 2.10004497, -0.175761998)
5984
Part155.Orientation = Vector3.new(0, -37.8499985, 0)
5985
Part155.Color = Color3.new(0.105882, 0.164706, 0.207843)
5986
BlockMesh156.Parent = Part155
5987
BlockMesh156.Scale = Vector3.new(1, 0.5, 0.5)
5988
BlockMesh156.Scale = Vector3.new(1, 0.5, 0.5)
5989
Part157.Name = "GlassPart"
5990
Part157.Parent = Tool81
5991
Part157.Material = Enum.Material.Glass
5992
Part157.BrickColor = BrickColor.new("Institutional white")
5993
Part157.Transparency = 0.5
5994
Part157.Rotation = Vector3.new(0, -18.9200001, 0)
5995
Part157.FormFactor = Enum.FormFactor.Custom
5996
Part157.Size = Vector3.new(1.5, 2.20000005, 0.200000003)
5997
Part157.CFrame = CFrame.new(12.6836081, 3.24583912, 0.277363002, 0.945954859, -3.51188464e-05, -0.324295938, 2.50855555e-05, 1, -3.51188464e-05, 0.324295938, 2.50855555e-05, 0.945954859)
5998
Part157.BottomSurface = Enum.SurfaceType.Smooth
5999
Part157.TopSurface = Enum.SurfaceType.Smooth
6000
Part157.Color = Color3.new(0.972549, 0.972549, 0.972549)
6001
Part157.Position = Vector3.new(12.6836081, 3.24583912, 0.277363002)
6002
Part157.Orientation = Vector3.new(0, -18.9200001, 0)
6003
Part157.Color = Color3.new(0.972549, 0.972549, 0.972549)
6004
BlockMesh158.Parent = Part157
6005
BlockMesh158.Offset = Vector3.new(0, 0, 0.0494999997)
6006
BlockMesh158.Scale = Vector3.new(1, 1, 0)
6007
BlockMesh158.Scale = Vector3.new(1, 1, 0)
6008
Part159.Name = "GlassPart"
6009
Part159.Parent = Tool81
6010
Part159.Material = Enum.Material.Glass
6011
Part159.BrickColor = BrickColor.new("Institutional white")
6012
Part159.Transparency = 0.5
6013
Part159.Rotation = Vector3.new(0, 52.1499977, 180)
6014
Part159.FormFactor = Enum.FormFactor.Custom
6015
Part159.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
6016
Part159.CFrame = CFrame.new(11.2812042, 2.27716804, -0.340557009, -0.613584697, -1.39968042e-05, 0.789628863, 4.08246196e-05, -1, 1.39971562e-05, 0.789628863, 4.08247397e-05, 0.613584757)
6017
Part159.BottomSurface = Enum.SurfaceType.Smooth
6018
Part159.TopSurface = Enum.SurfaceType.Smooth
6019
Part159.Color = Color3.new(0.972549, 0.972549, 0.972549)
6020
Part159.Position = Vector3.new(11.2812042, 2.27716804, -0.340557009)
6021
Part159.Orientation = Vector3.new(0, 52.1499977, 180)
6022
Part159.Color = Color3.new(0.972549, 0.972549, 0.972549)
6023
SpecialMesh160.Parent = Part159
6024
SpecialMesh160.Scale = Vector3.new(0, 1, 1)
6025
SpecialMesh160.MeshType = Enum.MeshType.Wedge
6026
SpecialMesh160.Scale = Vector3.new(0, 1, 1)
6027
Part161.Parent = Tool81
6028
Part161.Material = Enum.Material.Metal
6029
Part161.BrickColor = BrickColor.new("Black")
6030
Part161.Rotation = Vector3.new(0, -9.46000004, 0)
6031
Part161.FormFactor = Enum.FormFactor.Custom
6032
Part161.Size = Vector3.new(0.5, 0.200000003, 0.200000003)
6033
Part161.CFrame = CFrame.new(13.3488922, 2.10008693, 0.559585989, 0.986395717, 3.29302056e-05, -0.164386213, -2.78963325e-05, 1, 3.29302056e-05, 0.164386213, -2.78963325e-05, 0.986395717)
6034
Part161.BottomSurface = Enum.SurfaceType.Smooth
6035
Part161.TopSurface = Enum.SurfaceType.Smooth
6036
Part161.Color = Color3.new(0.105882, 0.164706, 0.207843)
6037
Part161.Position = Vector3.new(13.3488922, 2.10008693, 0.559585989)
6038
Part161.Orientation = Vector3.new(0, -9.46000004, 0)
6039
Part161.Color = Color3.new(0.105882, 0.164706, 0.207843)
6040
BlockMesh162.Parent = Part161
6041
BlockMesh162.Scale = Vector3.new(1, 0.5, 0.5)
6042
BlockMesh162.Scale = Vector3.new(1, 0.5, 0.5)
6043
Part163.Parent = Tool81
6044
Part163.Material = Enum.Material.Metal
6045
Part163.BrickColor = BrickColor.new("Black")
6046
Part163.Rotation = Vector3.new(-121.529999, -33.9399986, -137.699997)
6047
Part163.FormFactor = Enum.FormFactor.Custom
6048
Part163.Size = Vector3.new(0.200000003, 0.200000003, 0.400000006)
6049
Part163.CFrame = CFrame.new(11.2935324, 2.22686911, -0.394268006, -0.613650262, 0.558344007, -0.558287859, -3.65348205e-05, 0.707051158, 0.70716244, 0.789577901, 0.433970869, -0.433861732)
6050
Part163.BottomSurface = Enum.SurfaceType.Smooth
6051
Part163.TopSurface = Enum.SurfaceType.Smooth
6052
Part163.Color = Color3.new(0.105882, 0.164706, 0.207843)
6053
Part163.Position = Vector3.new(11.2935324, 2.22686911, -0.394268006)
6054
Part163.Orientation = Vector3.new(-45, -127.849998, 0)
6055
Part163.Color = Color3.new(0.105882, 0.164706, 0.207843)
6056
BlockMesh164.Parent = Part163
6057
BlockMesh164.Scale = Vector3.new(0.5, 0.5, 1)
6058
BlockMesh164.Scale = Vector3.new(0.5, 0.5, 1)
6059
Part165.Name = "GlassPart"
6060
Part165.Parent = Tool81
6061
Part165.Material = Enum.Material.Glass
6062
Part165.BrickColor = BrickColor.new("Institutional white")
6063
Part165.Transparency = 0.5
6064
Part165.FormFactor = Enum.FormFactor.Custom
6065
Part165.Size = Vector3.new(0.400000006, 2, 0.200000003)
6066
Part165.CFrame = CFrame.new(14.0699615, 3.37708712, 0.599873006, 1, 3.05171125e-05, -3.05161811e-05, -3.05161811e-05, 1, 3.05171125e-05, 3.05171125e-05, -3.05161811e-05, 1)
6067
Part165.BottomSurface = Enum.SurfaceType.Smooth
6068
Part165.TopSurface = Enum.SurfaceType.Smooth
6069
Part165.Color = Color3.new(0.972549, 0.972549, 0.972549)
6070
Part165.Position = Vector3.new(14.0699615, 3.37708712, 0.599873006)
6071
Part165.Color = Color3.new(0.972549, 0.972549, 0.972549)
6072
BlockMesh166.Parent = Part165
6073
BlockMesh166.Offset = Vector3.new(0, 0, 0.0494999997)
6074
BlockMesh166.Scale = Vector3.new(1, 1, 0)
6075
BlockMesh166.Scale = Vector3.new(1, 1, 0)
6076
Part167.Parent = Tool81
6077
Part167.Material = Enum.Material.Metal
6078
Part167.BrickColor = BrickColor.new("Black")
6079
Part167.FormFactor = Enum.FormFactor.Custom
6080
Part167.Size = Vector3.new(0.200000003, 2, 0.200000003)
6081
Part167.CFrame = CFrame.new(14.3200836, 3.3331151, 0.599873006, 1, 3.05171125e-05, -3.05161811e-05, -3.05161811e-05, 1, 3.05171125e-05, 3.05171125e-05, -3.05161811e-05, 1)
6082
Part167.BottomSurface = Enum.SurfaceType.Smooth
6083
Part167.TopSurface = Enum.SurfaceType.Smooth
6084
Part167.Color = Color3.new(0.105882, 0.164706, 0.207843)
6085
Part167.Position = Vector3.new(14.3200836, 3.3331151, 0.599873006)
6086
Part167.Color = Color3.new(0.105882, 0.164706, 0.207843)
6087
BlockMesh168.Parent = Part167
6088
BlockMesh168.Scale = Vector3.new(0.5, 1, 0.5)
6089
BlockMesh168.Scale = Vector3.new(0.5, 1, 0.5)
6090
Part169.Parent = Tool81
6091
Part169.Material = Enum.Material.Metal
6092
Part169.BrickColor = BrickColor.new("Black")
6093
Part169.Rotation = Vector3.new(0, -28.3899994, 0)
6094
Part169.FormFactor = Enum.FormFactor.Custom
6095
Part169.Size = Vector3.new(0.5, 0.200000003, 0.200000003)
6096
Part169.CFrame = CFrame.new(11.9851217, 2.10004497, 0.0920599997, 0.879726708, 3.70690686e-05, -0.475472778, -2.21015525e-05, 1, 3.70690686e-05, 0.475472778, -2.21015525e-05, 0.879726708)
6097
Part169.BottomSurface = Enum.SurfaceType.Smooth
6098
Part169.TopSurface = Enum.SurfaceType.Smooth
6099
Part169.Color = Color3.new(0.105882, 0.164706, 0.207843)
6100
Part169.Position = Vector3.new(11.9851217, 2.10004497, 0.0920599997)
6101
Part169.Orientation = Vector3.new(0, -28.3899994, 0)
6102
Part169.Color = Color3.new(0.105882, 0.164706, 0.207843)
6103
BlockMesh170.Parent = Part169
6104
BlockMesh170.Scale = Vector3.new(1, 0.5, 0.5)
6105
BlockMesh170.Scale = Vector3.new(1, 0.5, 0.5)
6106
Part171.Name = "Handle"
6107
Part171.Parent = Tool81
6108
Part171.Material = Enum.Material.Metal
6109
Part171.BrickColor = BrickColor.new("Black")
6110
Part171.Transparency = 1
6111
Part171.Rotation = Vector3.new(-179.979996, -71.0699997, -179.98999)
6112
Part171.FormFactor = Enum.FormFactor.Custom
6113
Part171.Size = Vector3.new(0.25, 0.25, 1.10000002)
6114
Part171.CFrame = CFrame.new(12.7889557, 4.75803518, -0.0302540008, -0.324365765, 7.80466871e-05, -0.945931733, -2.83790778e-05, 1, 9.22390973e-05, 0.945931733, 5.67638745e-05, -0.324365765)
6115
Part171.BottomSurface = Enum.SurfaceType.Smooth
6116
Part171.TopSurface = Enum.SurfaceType.Smooth
6117
Part171.Color = Color3.new(0.105882, 0.164706, 0.207843)
6118
Part171.Position = Vector3.new(12.7889557, 4.75803518, -0.0302540008)
6119
Part171.Orientation = Vector3.new(-0.00999999978, -108.93, 0)
6120
Part171.Color = Color3.new(0.105882, 0.164706, 0.207843)
6121
BlockMesh172.Parent = Part171
6122
Sound173.Name = "Reload"
6123
Sound173.Parent = Part171
6124
Sound173.Pitch = 1.2999999523163
6125
Sound173.SoundId = "http://www.roblox.com/asset/?version=1&id=2691591"
6126
Sound173.Volume = 0.60000002384186
6127
Sound174.Name = "Trigger"
6128
Sound174.Parent = Part171
6129
Sound174.Pitch = 2
6130
Sound174.SoundId = "rbxasset://sounds//switch.wav"
6131
Sound174.Volume = 1
6132
Sound175.Name = "Fire"
6133
Sound175.Parent = Part171
6134
Sound175.Pitch = 3
6135
Sound175.SoundId = "http://www.roblox.com/asset/?id=10730819"
6136
Sound175.Volume = 1
6137
Sound175.PlayOnRemove = true
6138
for i,v in pairs(mas:GetChildren()) do
6139
	v.Parent = game:GetService("Players").LocalPlayer.Backpack
6140
	pcall(function() v:MakeJoints() end)
6141
end
6142
mas:Destroy()
6143
for i,v in pairs(cors) do
6144
	spawn(function()
6145
		pcall(v)
6146
	end)
6147
end
6148
6149
--Converted with ttyyuu12345's model to script plugin v4
6150
function sandbox(var,func)
6151
	local env = getfenv(func)
6152
	local newenv = setmetatable({},{
6153
		__index = function(self,k)
6154
			if k=="script" then
6155
				return var
6156
			else
6157
				return env[k]
6158
			end
6159
		end,
6160
	})
6161
	setfenv(func,newenv)
6162
	return func
6163
end
6164
cors = {}
6165
mas = Instance.new("Model",game:GetService("Lighting"))
6166
Tool0 = Instance.new("Tool")
6167
IntValue1 = Instance.new("IntValue")
6168
Animation2 = Instance.new("Animation")
6169
Part3 = Instance.new("Part")
6170
Sound4 = Instance.new("Sound")
6171
Sound5 = Instance.new("Sound")
6172
Sound6 = Instance.new("Sound")
6173
SpecialMesh7 = Instance.new("SpecialMesh")
6174
Part8 = Instance.new("Part")
6175
CylinderMesh9 = Instance.new("CylinderMesh")
6176
PointLight10 = Instance.new("PointLight")
6177
BillboardGui11 = Instance.new("BillboardGui")
6178
ImageLabel12 = Instance.new("ImageLabel")
6179
Part13 = Instance.new("Part")
6180
SpecialMesh14 = Instance.new("SpecialMesh")
6181
PointLight15 = Instance.new("PointLight")
6182
BillboardGui16 = Instance.new("BillboardGui")
6183
ImageLabel17 = Instance.new("ImageLabel")
6184
Part18 = Instance.new("Part")
6185
SpecialMesh19 = Instance.new("SpecialMesh")
6186
PointLight20 = Instance.new("PointLight")
6187
BillboardGui21 = Instance.new("BillboardGui")
6188
ImageLabel22 = Instance.new("ImageLabel")
6189
Part23 = Instance.new("Part")
6190
SpecialMesh24 = Instance.new("SpecialMesh")
6191
BillboardGui25 = Instance.new("BillboardGui")
6192
ImageLabel26 = Instance.new("ImageLabel")
6193
SurfaceLight27 = Instance.new("SurfaceLight")
6194
Script28 = Instance.new("Script")
6195
Script29 = Instance.new("Script")
6196
LocalScript30 = Instance.new("LocalScript")
6197
ScreenGui31 = Instance.new("ScreenGui")
6198
TextLabel32 = Instance.new("TextLabel")
6199
TextLabel33 = Instance.new("TextLabel")
6200
Tool0.Name = "Bike"
6201
Tool0.Parent = mas
6202
Tool0.GripForward = Vector3.new(-0, 3.9340253e-07, -1)
6203
Tool0.GripPos = Vector3.new(1.5, 1.10000002, -0.800000012)
6204
Tool0.GripUp = Vector3.new(0, 1, 3.9340253e-07)
6205
Tool0.CanBeDropped = false
6206
IntValue1.Name = "IsReady"
6207
IntValue1.Parent = Tool0
6208
Animation2.Name = "holdAni"
6209
Animation2.Parent = Tool0
6210
Animation2.AnimationId = "http://www.roblox.com/Asset?ID=104506550"
6211
Part3.Name = "Handle"
6212
Part3.Parent = Tool0
6213
Part3.Material = Enum.Material.Fabric
6214
Part3.Elasticity = 0
6215
Part3.FormFactor = Enum.FormFactor.Custom
6216
Part3.Friction = 0
6217
Part3.Size = Vector3.new(0.200000003, 5, 7.91000128)
6218
Part3.CFrame = CFrame.new(82.3563538, 4.50000477, 70.8921051, 1, 0, 0, 0, 1, 0, 0, 0, 1)
6219
Part3.BottomSurface = Enum.SurfaceType.Smooth
6220
Part3.TopSurface = Enum.SurfaceType.Smooth
6221
Part3.Position = Vector3.new(82.3563538, 4.50000477, 70.8921051)
6222
Sound4.Name = "Running"
6223
Sound4.Parent = Part3
6224
Sound4.SoundId = "rbxassetid://288319082"
6225
Sound4.Volume = 0.30000001192093
6226
Sound4.Looped = true
6227
Sound5.Name = "Siren"
6228
Sound5.Parent = Part3
6229
Sound5.SoundId = "rbxassetid://295410986"
6230
Sound5.Volume = 10
6231
Sound5.Looped = true
6232
Sound6.Name = "Siren1"
6233
Sound6.Parent = Part3
6234
Sound6.SoundId = "rbxassetid://295410932"
6235
Sound6.Volume = 10
6236
Sound6.Looped = true
6237
SpecialMesh7.Parent = Part3
6238
SpecialMesh7.MeshId = "rbxassetid://575950615"
6239
SpecialMesh7.Offset = Vector3.new(0, 0, 0.300000012)
6240
SpecialMesh7.Scale = Vector3.new(0.0700000003, 0.0700000003, 0.0700000003)
6241
SpecialMesh7.TextureId = "rbxassetid://72012761"
6242
SpecialMesh7.MeshType = Enum.MeshType.FileMesh
6243
SpecialMesh7.Scale = Vector3.new(0.0700000003, 0.0700000003, 0.0700000003)
6244
Part8.Name = "BackLight"
6245
Part8.Parent = Tool0
6246
Part8.Material = Enum.Material.SmoothPlastic
6247
Part8.BrickColor = BrickColor.new("Deep blue")
6248
Part8.Reflectance = 0.10000000149012
6249
Part8.Transparency = 1
6250
Part8.Rotation = Vector3.new(0, -90, 0)
6251
Part8.CanCollide = false
6252
Part8.FormFactor = Enum.FormFactor.Custom
6253
Part8.Size = Vector3.new(0.400000006, 0.200000003, 0.300000012)
6254
Part8.CFrame = CFrame.new(83.0562744, 6.18976879, 74.8003235, 0, 0, -1, 0, 1, 0, 1, 0, 0)
6255
Part8.BottomSurface = Enum.SurfaceType.Smooth
6256
Part8.TopSurface = Enum.SurfaceType.Smooth
6257
Part8.Color = Color3.new(0.129412, 0.329412, 0.72549)
6258
Part8.Position = Vector3.new(83.0562744, 6.18976879, 74.8003235)
6259
Part8.Orientation = Vector3.new(0, -90, 0)
6260
Part8.Color = Color3.new(0.129412, 0.329412, 0.72549)
6261
CylinderMesh9.Parent = Part8
6262
CylinderMesh9.Offset = Vector3.new(0, -0.0500000007, 0)
6263
CylinderMesh9.Scale = Vector3.new(0.400000006, 0.5, 1)
6264
CylinderMesh9.Scale = Vector3.new(0.400000006, 0.5, 1)
6265
PointLight10.Name = "Light2"
6266
PointLight10.Parent = Part8
6267
PointLight10.Color = Color3.new(0, 0.666667, 1)
6268
PointLight10.Enabled = false
6269
PointLight10.Brightness = 5
6270
PointLight10.Color = Color3.new(0, 0.666667, 1)
6271
BillboardGui11.Name = "Light"
6272
BillboardGui11.Parent = Part8
6273
BillboardGui11.Size = UDim2.new(3, 0, 3, 0)
6274
BillboardGui11.Enabled = false
6275
BillboardGui11.ExtentsOffset = Vector3.new(0, 0, 1)
6276
ImageLabel12.Name = "Light"
6277
ImageLabel12.Parent = BillboardGui11
6278
ImageLabel12.Transparency = 1
6279
ImageLabel12.Size = UDim2.new(1, 0, 1, 0)
6280
ImageLabel12.BackgroundTransparency = 1
6281
ImageLabel12.Image = "http://www.roblox.com/asset/?id=134532208"
6282
Part13.Name = "LeftLight"
6283
Part13.Parent = Tool0
6284
Part13.Material = Enum.Material.SmoothPlastic
6285
Part13.BrickColor = BrickColor.new("Deep blue")
6286
Part13.Reflectance = 0.10000000149012
6287
Part13.Transparency = 1
6288
Part13.Rotation = Vector3.new(0, 0, -180)
6289
Part13.CanCollide = false
6290
Part13.FormFactor = Enum.FormFactor.Custom
6291
Part13.Size = Vector3.new(0.400000006, 0.200000003, 0.200000003)
6292
Part13.CFrame = CFrame.new(80.9499664, 5.62722111, 68.2604904, -1, 1.25603208e-07, -1.30385143e-08, -1.43017303e-07, -1, -2.98068983e-08, 5.58794211e-09, -1.1389605e-07, 1)
6293
Part13.BottomSurface = Enum.SurfaceType.Smooth
6294
Part13.TopSurface = Enum.SurfaceType.Smooth
6295
Part13.Color = Color3.new(0.129412, 0.329412, 0.72549)
6296
Part13.Position = Vector3.new(80.9499664, 5.62722111, 68.2604904)
6297
Part13.Orientation = Vector3.new(0, 0, -180)
6298
Part13.Color = Color3.new(0.129412, 0.329412, 0.72549)
6299
SpecialMesh14.Parent = Part13
6300
SpecialMesh14.MeshType = Enum.MeshType.Sphere
6301
PointLight15.Name = "Light2"
6302
PointLight15.Parent = Part13
6303
PointLight15.Color = Color3.new(0, 0.666667, 1)
6304
PointLight15.Enabled = false
6305
PointLight15.Brightness = 5
6306
PointLight15.Color = Color3.new(0, 0.666667, 1)
6307
BillboardGui16.Name = "Light"
6308
BillboardGui16.Parent = Part13
6309
BillboardGui16.Size = UDim2.new(3, 0, 3, 0)
6310
BillboardGui16.Enabled = false
6311
BillboardGui16.ExtentsOffset = Vector3.new(0, 0, 1)
6312
ImageLabel17.Name = "Light"
6313
ImageLabel17.Parent = BillboardGui16
6314
ImageLabel17.Transparency = 1
6315
ImageLabel17.Size = UDim2.new(1, 0, 1, 0)
6316
ImageLabel17.BackgroundTransparency = 1
6317
ImageLabel17.Image = "http://www.roblox.com/asset/?id=134532208"
6318
Part18.Name = "RightLight"
6319
Part18.Parent = Tool0
6320
Part18.Material = Enum.Material.SmoothPlastic
6321
Part18.BrickColor = BrickColor.new("Deep blue")
6322
Part18.Reflectance = 0.10000000149012
6323
Part18.Transparency = 1
6324
Part18.Rotation = Vector3.new(0, 0, -180)
6325
Part18.CanCollide = false
6326
Part18.FormFactor = Enum.FormFactor.Custom
6327
Part18.Size = Vector3.new(0.400000006, 0.200000003, 0.200000003)
6328
Part18.CFrame = CFrame.new(83.6999817, 5.62722111, 68.2604904, -1, 1.25603208e-07, -1.30385143e-08, -1.43017303e-07, -1, -2.98068983e-08, 5.58794211e-09, -1.1389605e-07, 1)
6329
Part18.BottomSurface = Enum.SurfaceType.Smooth
6330
Part18.TopSurface = Enum.SurfaceType.Smooth
6331
Part18.Color = Color3.new(0.129412, 0.329412, 0.72549)
6332
Part18.Position = Vector3.new(83.6999817, 5.62722111, 68.2604904)
6333
Part18.Orientation = Vector3.new(0, 0, -180)
6334
Part18.Color = Color3.new(0.129412, 0.329412, 0.72549)
6335
SpecialMesh19.Parent = Part18
6336
SpecialMesh19.MeshType = Enum.MeshType.Sphere
6337
PointLight20.Name = "Light2"
6338
PointLight20.Parent = Part18
6339
PointLight20.Color = Color3.new(0, 0.666667, 1)
6340
PointLight20.Enabled = false
6341
PointLight20.Brightness = 5
6342
PointLight20.Color = Color3.new(0, 0.666667, 1)
6343
BillboardGui21.Name = "Light"
6344
BillboardGui21.Parent = Part18
6345
BillboardGui21.Size = UDim2.new(3, 0, 3, 0)
6346
BillboardGui21.Enabled = false
6347
BillboardGui21.ExtentsOffset = Vector3.new(0, 0, 1)
6348
ImageLabel22.Name = "Light"
6349
ImageLabel22.Parent = BillboardGui21
6350
ImageLabel22.Transparency = 1
6351
ImageLabel22.Size = UDim2.new(1, 0, 1, 0)
6352
ImageLabel22.BackgroundTransparency = 1
6353
ImageLabel22.Image = "http://www.roblox.com/asset/?id=134532208"
6354
Part23.Name = "FrontLight"
6355
Part23.Parent = Tool0
6356
Part23.Material = Enum.Material.SmoothPlastic
6357
Part23.BrickColor = BrickColor.new("Deep blue")
6358
Part23.Reflectance = 0.10000000149012
6359
Part23.Transparency = 1
6360
Part23.Rotation = Vector3.new(0, 0, -180)
6361
Part23.CanCollide = false
6362
Part23.FormFactor = Enum.FormFactor.Custom
6363
Part23.Size = Vector3.new(0.5, 0.200000003, 0.200000003)
6364
Part23.CFrame = CFrame.new(82.3499832, 4.52722788, 67.5604935, -1, 1.25603208e-07, -1.30385143e-08, -1.43017303e-07, -1, -2.98068983e-08, 5.58794211e-09, -1.1389605e-07, 1)
6365
Part23.BottomSurface = Enum.SurfaceType.Smooth
6366
Part23.TopSurface = Enum.SurfaceType.Smooth
6367
Part23.Color = Color3.new(0.129412, 0.329412, 0.72549)
6368
Part23.Position = Vector3.new(82.3499832, 4.52722788, 67.5604935)
6369
Part23.Orientation = Vector3.new(0, 0, -180)
6370
Part23.Color = Color3.new(0.129412, 0.329412, 0.72549)
6371
SpecialMesh24.Parent = Part23
6372
SpecialMesh24.MeshType = Enum.MeshType.Sphere
6373
BillboardGui25.Name = "Light"
6374
BillboardGui25.Parent = Part23
6375
BillboardGui25.Size = UDim2.new(5, 0, 3, 0)
6376
BillboardGui25.Enabled = false
6377
BillboardGui25.ExtentsOffset = Vector3.new(0, 0, 1)
6378
ImageLabel26.Name = "Light"
6379
ImageLabel26.Parent = BillboardGui25
6380
ImageLabel26.Transparency = 1
6381
ImageLabel26.Size = UDim2.new(1, 0, 1, 0)
6382
ImageLabel26.BackgroundTransparency = 1
6383
ImageLabel26.Image = "http://www.roblox.com/asset/?id=23596922"
6384
SurfaceLight27.Name = "Light2"
6385
SurfaceLight27.Parent = Part23
6386
SurfaceLight27.Range = 19.239078521729
6387
SurfaceLight27.Angle = 57.401973724365
6388
Script28.Parent = Part23
6389
table.insert(cors,sandbox(Script28,function()
6390
while true do 
6391
	wait()
6392
if script.Parent.Parent.BackLight.Light.Enabled == true then
6393
	script.Parent.Light.Enabled = true
6394
	script.Parent.Light2.Enabled = true
6395
		else
6396
	script.Parent.Light.Enabled = false
6397
	script.Parent.Light2.Enabled = false
6398
		end
6399
end
6400
end))
6401
Script29.Name = "qPerfectionWeld"
6402
Script29.Parent = Tool0
6403
table.insert(cors,sandbox(Script29,function()
6404
-- Created by Quenty (@Quenty, follow me on twitter).
6405
-- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
6406
-- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
6407
6408
--[[ INSTRUCTIONS
6409
- Place in the model
6410
- Make sure model is anchored
6411
- That's it. It will weld the model and all children. 
6412
6413
THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED. 
6414
THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED. 
6415
THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED. 
6416
THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED. 
6417
THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED. 
6418
THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED. 
6419
THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED. 
6420
THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED. 
6421
6422
This script is designed to be used is a regular script. In a local script it will weld, but it will not attempt to handle ancestory changes. 
6423
]]
6424
6425
--[[ DOCUMENTATION
6426
- Will work in tools. If ran more than once it will not create more than one weld.  This is especially useful for tools that are dropped and then picked up again.
6427
- Will work in PBS servers
6428
- Will work as long as it starts out with the part anchored
6429
- Stores the relative CFrame as a CFrame value
6430
- Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
6431
- Utilizes a recursive algorith to find all parts in the model
6432
- Will reweld on script reparent if the script is initially parented to a tool.
6433
- Welds as fast as possible
6434
]]
6435
6436
-- qPerfectionWeld.lua
6437
-- Created 10/6/2014
6438
-- Author: Quenty
6439
-- Version 1.0.3
6440
6441
-- Updated 10/14/2014 - Updated to 1.0.1
6442
--- Bug fix with existing ROBLOX welds ? Repro by asimo3089
6443
6444
-- Updated 10/14/2014 - Updated to 1.0.2
6445
--- Fixed bug fix. 
6446
6447
-- Updated 10/14/2014 - Updated to 1.0.3
6448
--- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
6449
6450
local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
6451
6452
6453
local function CallOnChildren(Instance, FunctionToCall)
6454
	-- Calls a function on each of the children of a certain object, using recursion.  
6455
6456
	FunctionToCall(Instance)
6457
6458
	for _, Child in next, Instance:GetChildren() do
6459
		CallOnChildren(Child, FunctionToCall)
6460
	end
6461
end
6462
6463
local function GetNearestParent(Instance, ClassName)
6464
	-- Returns the nearest parent of a certain class, or returns nil
6465
6466
	local Ancestor = Instance
6467
	repeat
6468
		Ancestor = Ancestor.Parent
6469
		if Ancestor == nil then
6470
			return nil
6471
		end
6472
	until Ancestor:IsA(ClassName)
6473
6474
	return Ancestor
6475
end
6476
6477
local function GetBricks(StartInstance)
6478
	local List = {}
6479
6480
	-- if StartInstance:IsA("BasePart") then
6481
	-- 	List[#List+1] = StartInstance
6482
	-- end
6483
6484
	CallOnChildren(StartInstance, function(Item)
6485
		if Item:IsA("BasePart") then
6486
			List[#List+1] = Item;
6487
		end
6488
	end)
6489
6490
	return List
6491
end
6492
6493
local function Modify(Instance, Values)
6494
	-- Modifies an Instance by using a table.  
6495
6496
	assert(type(Values) == "table", "Values is not a table");
6497
6498
	for Index, Value in next, Values do
6499
		if type(Index) == "number" then
6500
			Value.Parent = Instance
6501
		else
6502
			Instance[Index] = Value
6503
		end
6504
	end
6505
	return Instance
6506
end
6507
6508
local function Make(ClassType, Properties)
6509
	-- Using a syntax hack to create a nice way to Make new items.  
6510
6511
	return Modify(Instance.new(ClassType), Properties)
6512
end
6513
6514
local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
6515
local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
6516
6517
local function HasWheelJoint(Part)
6518
	for _, SurfaceName in pairs(Surfaces) do
6519
		for _, HingSurfaceName in pairs(HingSurfaces) do
6520
			if Part[SurfaceName].Name == HingSurfaceName then
6521
				return true
6522
			end
6523
		end
6524
	end
6525
	
6526
	return false
6527
end
6528
6529
local function ShouldBreakJoints(Part)
6530
	--- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
6531
	--  definitely some edge cases. 
6532
6533
	if NEVER_BREAK_JOINTS then
6534
		return false
6535
	end
6536
	
6537
	if HasWheelJoint(Part) then
6538
		return false
6539
	end
6540
	
6541
	local Connected = Part:GetConnectedParts()
6542
	
6543
	if #Connected == 1 then
6544
		return false
6545
	end
6546
	
6547
	for _, Item in pairs(Connected) do
6548
		if HasWheelJoint(Item) then
6549
			return false
6550
		elseif not Item:IsDescendantOf(script.Parent) then
6551
			return false
6552
		end
6553
	end
6554
	
6555
	return true
6556
end
6557
6558
local function WeldTogether(Part0, Part1, JointType, WeldParent)
6559
	--- Weld's 2 parts together
6560
	-- @param Part0 The first part
6561
	-- @param Part1 The second part (Dependent part most of the time).
6562
	-- @param [JointType] The type of joint. Defaults to weld.
6563
	-- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
6564
	-- @return The weld created.
6565
6566
	JointType = JointType or "Weld"
6567
	local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
6568
	
6569
	local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
6570
	Modify(NewWeld, {
6571
		Name = "qCFrameWeldThingy";
6572
		Part0  = Part0;
6573
		Part1  = Part1;
6574
		C0     = CFrame.new();--Part0.CFrame:inverse();
6575
		C1     = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
6576
		Parent = Part1;
6577
	})
6578
6579
	if not RelativeValue then
6580
		RelativeValue = Make("CFrameValue", {
6581
			Parent     = Part1;
6582
			Name       = "qRelativeCFrameWeldValue";
6583
			Archivable = true;
6584
			Value      = NewWeld.C1;
6585
		})
6586
	end
6587
6588
	return NewWeld
6589
end
6590
6591
local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
6592
	-- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
6593
	-- @param MainPart The part to weld the model to (can be in the model).
6594
	-- @param [JointType] The type of joint. Defaults to weld. 
6595
	-- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
6596
	
6597
	for _, Part in pairs(Parts) do
6598
		if ShouldBreakJoints(Part) then
6599
			Part:BreakJoints()
6600
		end
6601
	end
6602
	
6603
	for _, Part in pairs(Parts) do
6604
		if Part ~= MainPart then
6605
			WeldTogether(MainPart, Part, JointType, MainPart)
6606
		end
6607
	end
6608
6609
	if not DoNotUnanchor then
6610
		for _, Part in pairs(Parts) do
6611
			Part.Anchored = false
6612
		end
6613
		MainPart.Anchored = false
6614
	end
6615
end
6616
6617
local function PerfectionWeld()	
6618
	local Tool = GetNearestParent(script, "Tool")
6619
6620
	local Parts = GetBricks(script.Parent)
6621
	local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
6622
6623
	if PrimaryPart then
6624
		WeldParts(Parts, PrimaryPart, "Weld", false)
6625
	else
6626
		warn("qWeld - Unable to weld part")
6627
	end
6628
	
6629
	return Tool
6630
end
6631
6632
local Tool = PerfectionWeld()
6633
6634
6635
if Tool and script.ClassName == "Script" then
6636
	--- Don't bother with local scripts
6637
6638
	script.Parent.AncestryChanged:connect(function()
6639
		PerfectionWeld()
6640
	end)
6641
end
6642
6643
-- Created by Quenty (@Quenty, follow me on twitter).
6644
6645
end))
6646
LocalScript30.Name = "continuumScript"
6647
LocalScript30.Parent = Tool0
6648
table.insert(cors,sandbox(LocalScript30,function()
6649
function WaitForChild(parent,child)
6650
	return parent[child]
6651
end
6652
6653
local int = WaitForChild(script.Parent,'IsReady')
6654
local handle = WaitForChild(script.Parent,'Handle')
6655
local BackLight = WaitForChild(script.Parent,'BackLight')
6656
local LeftLight = WaitForChild(script.Parent,'LeftLight')
6657
local RightLight = WaitForChild(script.Parent,'RightLight')
6658
local EngineSound = WaitForChild(handle,'Running')
6659
local gui2 = nil
6660
local radio = false
6661
local siren = false
6662
local siren2 = false
6663
6664
local HoldAni = WaitForChild(script.Parent,'holdAni')
6665
6666
local lights = false
6667
local left=false
6668
local right=false
6669
local up=false
6670
local down=false
6671
local mouse
6672
local Character
6673
local key_down_connect
6674
local key_up_connect
6675
6676
local thrustForce
6677
local thrustMagnitude
6678
local thrustDirection
6679
local RotationForce
6680
local TurnGyro
6681
6682
local HoldAniTrack
6683
6684
local torsoWeld
6685
6686
local SmokePart = Instance.new('Part')
6687
SmokePart.Transparency = 1
6688
SmokePart.Size = Vector3.new(0,0,0)
6689
local ExhaustSmoke = Instance.new('Smoke')
6690
ExhaustSmoke.Parent = SmokePart
6691
ExhaustSmoke.Size = .1
6692
ExhaustSmoke.RiseVelocity = .01
6693
ExhaustSmoke.Color = Color3.new(.5,.5,.5)
6694
ExhaustSmoke.Enabled = false
6695
6696
local acceleration = 30
6697
local deceleration = 25
6698
local turnAlpha = .25
6699
local alphaDampening = .15
6700
6701
local Equipped = false
6702
6703
local LastPosition = nil
6704
local ActualVelocity = Vector3.new(0,0,0)
6705
6706
local FakeHandle = nil
6707
local FrontWheel = Instance.new('Part')
6708
FrontWheel.FormFactor = 'Custom'
6709
FrontWheel.CanCollide = false
6710
FrontWheel.Size = Vector3.new(0,0,0)
6711
6712
local WheelMesh = Instance.new('SpecialMesh')
6713
WheelMesh.MeshId = "http://www.roblox.com/asset/?id=438123816"
6714
WheelMesh.TextureId = "http://www.roblox.com/asset/?id=438106307"
6715
WheelMesh.Scale = Vector3.new(0.007,0.007,0.007)
6716
	
6717
local Light = FrontWheel:Clone()
6718
local LightWeld = nil
6719
6720
local FrontMotor = nil
6721
local BackWheel = FrontWheel:Clone()
6722
local BackMotor = nil
6723
6724
local CurrentSpeed=0
6725
local turnSpeed=0
6726
local turnSpeedAim=10
6727
6728
function ThrustUpdater()
6729
coroutine.resume(coroutine.create(function()
6730
	while Equipped do wait()
6731
		if lights then
6732
		BackLight.Light.Enabled = true
6733
		LeftLight.Light.Enabled = true
6734
		BackLight.Light2.Enabled = true
6735
		LeftLight.Light2.Enabled = true
6736
		wait(0.1)
6737
		RightLight.Light.Enabled = true
6738
		LeftLight.Light.Enabled = false
6739
		RightLight.Light2.Enabled = true
6740
		LeftLight.Light2.Enabled = false
6741
		wait(0.1)
6742
		RightLight.Light.Enabled = false
6743
		BackLight.Light.Enabled = false
6744
		RightLight.Light2.Enabled = false
6745
		BackLight.Light2.Enabled = false
6746
		wait(0.1)
6747
		BackLight.Light.Enabled = false
6748
		LeftLight.Light.Enabled = false
6749
		RightLight.Light.Enabled = false
6750
		BackLight.Light2.Enabled = false
6751
		LeftLight.Light2.Enabled = false
6752
		RightLight.Light2.Enabled = false wait(0.1)
6753
		end
6754
	end
6755
lights = false
6756
BackLight.Material = "SmoothPlastic"
6757
LeftLight.Material = "SmoothPlastic"
6758
RightLight.Material = "SmoothPlastic"
6759
BackLight.Light2.Enabled = false
6760
LeftLight.Light2.Enabled = false
6761
RightLight.Light2.Enabled = false
6762
end))
6763
if not script:findFirstChild("Selected") then
6764
Instance.new("IntValue",script).Name = "Selected"
6765
game.Players[script.Parent.Parent.Name].Chatted:connect(function(MSG)
6766
	if radio and game.Lighting:findFirstChild("OfficerRadioSystem") and game.Players[script.Parent.Parent.Name]:findFirstChild("PlayerGui") then
6767
		if game.Players[script.Parent.Parent.Name].PlayerGui:findFirstChild("OfficerRadio") and Equipped then
6768
		local Channel = game.Lighting["OfficerRadioSystem"]
6769
		Channel.Line1.Value = Channel.Line2.Value
6770
		Channel.Line2.Value = Channel.Line3.Value
6771
		Channel.Line3.Value = Channel.Line4.Value
6772
		Channel.Line4.Value = Channel.Line5.Value
6773
		Channel.Line5.Value = Channel.Line6.Value
6774
		Channel.Line6.Value = Channel.Line7.Value
6775
		Channel.Line7.Value = script.Parent.Parent.Name..": "..MSG
6776
		end
6777
	end
6778
end)
6779
end
6780
	while Equipped do
6781
		local direction = Character:FindFirstChild("Torso").CFrame.lookVector
6782
		direction = Vector3.new(direction.x,0,direction.z).unit
6783
		thrustForce.velocity = direction*(CurrentSpeed)
6784
		EngineSound.Pitch =	1+(math.abs(CurrentSpeed/50)*1)
6785
		
6786
		if FrontMotor then
6787
			FrontMotor.DesiredAngle=(999999999)*	(-CurrentSpeed/math.abs(CurrentSpeed))
6788
			FrontMotor.MaxVelocity = CurrentSpeed/250
6789
			if BackMotor then 
6790
				BackMotor.DesiredAngle = FrontMotor.DesiredAngle
6791
				BackMotor.MaxVelocity = FrontMotor.MaxVelocity	
6792
			end	
6793
		end
6794
		
6795
		RotationForce.angularvelocity = Vector3.new(0, turnSpeed, 0)
6796
		if math.abs(turnSpeed)>alphaDampening	 then
6797
			turnSpeed= turnSpeed-((alphaDampening)*(math.abs(turnSpeed)/turnSpeed))
6798
		else 
6799
			turnSpeed = 0		
6800
		end
6801
		local leanAmount= -turnSpeed*(math.pi/6)/10 --FIND ME
6802
		
6803
		if not forwards or back then
6804
			CurrentSpeed = CurrentSpeed*.99			
6805
		end		
6806
		
6807
		local xzAngle = math.atan2(Character.Torso.CFrame.lookVector.z,0, Character.Torso.CFrame.lookVector.x)
6808
		TurnGyro.cframe=CFrame.Angles(leanAmount*direction.x,0,leanAmount*direction.z)
6809
		ExhaustSmoke.Opacity = (math.min(math.abs(CurrentSpeed),10)/10)*.5
6810
		if LastPosition then
6811
			local npos = Vector3.new(Character.Torso.CFrame.p.x,0,Character.Torso.CFrame.p.z)
6812
			--(npos-LastPosition).magnitude
6813
			local myspeed =Vector3.new(FakeHandle.Velocity.X,0,FakeHandle.Velocity.Z).magnitude
6814
			local velocityDifference = math.abs((myspeed - (thrustForce.velocity.magnitude)))
6815
			if myspeed>3 and thrustForce.velocity.magnitude>3 and velocityDifference> .7*thrustForce.velocity.magnitude then
6816
				CurrentSpeed=CurrentSpeed*.9
6817
			end
6818
			
6819
		end
6820
		LastPosition = Vector3.new(Character.Torso.CFrame.p.x,0,Character.Torso.CFrame.p.z)
6821
		wait(1/60)
6822
	end
6823
	
6824
end
6825
6826
6827
function onEquipped(nmouse)
6828
	Spawn(function()
6829
		if Equipped then
6830
			return
6831
		end
6832
		--
6833
		local gui = WaitForChild(game.Players[script.Parent.Parent.Name],"PlayerGui")
6834
		gui2 = script.BikeGui:Clone()
6835
		gui2.Parent = gui
6836
			Character=script.Parent.Parent
6837
			local myTorso = WaitForChild(Character,'Torso')
6838
			if not FakeHandle then
6839
				FakeHandle = handle:Clone()
6840
				FakeHandle.Name = 'FakeHandle'
6841
				FakeHandle.Size = Vector3.new(1, 7, 6)
6842
				FakeHandle:WaitForChild('Mesh').MeshId = "http://www.roblox.com/asset/?id=575950615"
6843
				
6844
			end
6845
			FakeHandle.Parent = script.Parent
6846
			FakeHandle.CFrame = myTorso.CFrame
6847
			handle.Transparency = 1
6848
6849
			Spawn(function()
6850
				
6851
				FrontWheel.Parent = FakeHandle
6852
					FrontMotor = Instance.new('Motor6D')
6853
					FrontMotor.C0 = CFrame.new(0, -2.4, -3.02) * CFrame.Angles(0, (math.pi / 2), 0)
6854
					FrontMotor.C1 = CFrame.new() * CFrame.Angles(0, -(math.pi / 2), 0)
6855
					FrontMotor.Part0 = FakeHandle
6856
					FrontMotor.Part1 = FrontWheel
6857
					FrontMotor.Parent =FakeHandle
6858
				WheelMesh:Clone().Parent = FrontWheel
6859
					
6860
				BackWheel.Parent = FakeHandle
6861
					BackMotor = Instance.new('Motor6D')
6862
					BackMotor.C0 = CFrame.new(0, -2.4, 2.9) * CFrame.Angles(0, (math.pi / 2), 0)
6863
					BackMotor.C1 = CFrame.new() * CFrame.Angles(0, -(math.pi / 2), 0)
6864
					BackMotor.Part0 = FakeHandle
6865
					BackMotor.Part1 = BackWheel
6866
					BackMotor.Parent =FakeHandle
6867
				WheelMesh:Clone().Parent = BackWheel
6868
				
6869
				Light.Parent = FakeHandle
6870
					LightWeld = Instance.new('Weld')
6871
					LightWeld.C0 = CFrame.new(0, 0, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
6872
					LightWeld.C1 = CFrame.new(-0.140708923, -0.749996185, -0.9377985, -1.63912773e-007, -1.27675008e-008, -1.00000024, -2.05633661e-008, 0.99999994, 3.65663944e-009, 0.999999881, 5.65337004e-008, -7.4505806e-008)
6873
					LightWeld.Part0 = FakeHandle
6874
					LightWeld.Part1 = Light
6875
					LightWeld.Parent = FakeHandle
6876
					local tlight = Instance.new('SpotLight')
6877
					tlight.Brightness = 1
6878
					tlight.Angle=45
6879
					tlight.Color = Color3.new(255/255,252/255,153/255)
6880
					tlight.Parent = Light
6881
					tlight.Range = 40
6882
					
6883
			end)
6884
			
6885
			CurrentSpeed=0
6886
			turnSpeed=0
6887
			mouse=nmouse
6888
			Equipped = true
6889
			
6890
			handle.CFrame = myTorso.CFrame
6891
			WaitForChild(Character,'Humanoid').PlatformStand = true
6892
			
6893
			if RotationForce then RotationForce:Destroy() end
6894
			RotationForce = Instance.new('BodyAngularVelocity')
6895
			RotationForce.maxTorque = Vector3.new(0, math.huge, 0)
6896
			RotationForce.angularvelocity = Vector3.new(0, 0, 0)
6897
			RotationForce.Parent = myTorso
6898
			
6899
			if thrustForce then thrustForce:Destroy() end
6900
			thrustForce = Instance.new('BodyVelocity')
6901
			thrustForce.maxForce = Vector3.new(math.huge,0,math.huge)
6902
			thrustForce.velocity = Vector3.new(0,0,0)
6903
			thrustForce.P = 100
6904
			thrustForce.Parent = FakeHandle--myTorso
6905
			
6906
			if TurnGyro then TurnGyro:Destroy() end
6907
			TurnGyro = Instance.new('BodyGyro')
6908
			TurnGyro.maxTorque = Vector3.new(5000,0,5000)
6909
			TurnGyro.P = 300
6910
			TurnGyro.D=100
6911
			TurnGyro.Parent = myTorso
6912
			
6913
			Spawn(ThrustUpdater)
6914
			if HoldAniTrack then HoldAniTrack:Stop() end
6915
			HoldAniTrack = WaitForChild(Character,'Humanoid'):LoadAnimation(HoldAni)
6916
			HoldAniTrack:Play()
6917
			Spawn(function()
6918
				
6919
				
6920
				myTorso.Anchored = true
6921
				myTorso.CFrame = myTorso.CFrame+Vector3.new(0,3,0)
6922
				
6923
				if torsoWeld then torsoWeld:Destroy() end
6924
				torsoWeld=Instance.new('Weld')
6925
				torsoWeld.C0 = CFrame.Angles(0,0,0) + Vector3.new(0, -0.6, -0.7) --FIND ME -1.6
6926
				torsoWeld.Part0 = myTorso
6927
				torsoWeld.Part1 = FakeHandle
6928
				torsoWeld.Parent = FakeHandle
6929
				FakeHandle.CanCollide = true
6930
				
6931
				wait(.1)
6932
				FakeHandle.CanCollide = true
6933
				myTorso.Anchored = false
6934
				myTorso.CFrame = myTorso.CFrame+Vector3.new(0,3,0)
6935
			end)
6936
			
6937
			if key_down_connect then
6938
				key_down_connect:disconnect()
6939
				key_up_connect:disconnect()
6940
			end
6941
			key_down_connect=mouse.KeyDown:connect(keyDownFunc)
6942
			key_up_connect=mouse.KeyUp:connect(keyUpFunc)
6943
		
6944
			SmokePart.Parent = FakeHandle
6945
6946
			local tweld=Instance.new('Weld')
6947
			tweld.C0 = CFrame.new(0.600000024, 1.10000014, -2.20000005, 1, 0, 0, 0, 1, 0, 0, 0, 1)
6948
			tweld.Part0 = SmokePart
6949
			tweld.Part1 = FakeHandle
6950
			tweld.Parent = SmokePart
6951
			
6952
			EngineSound:Play()
6953
			Character.Humanoid.WalkSpeed = 0
6954
		--end
6955
	end)
6956
end
6957
6958
6959
function onUnequipped()
6960
	Equipped = false
6961
	if gui2 then
6962
	gui2:Remove() gui2 = nil
6963
	end
6964
	if SmokePart then
6965
		SmokePart.Parent = nil
6966
	end
6967
	if FakeHandle then
6968
		FakeHandle:Remove()
6969
		FakeHandle = nil
6970
	end
6971
	handle.Transparency = 0
6972
	--handle.Size = Vector3.new(0.2, 0.2, 0.2)
6973
	forwards = false
6974
	left = false
6975
	back = false
6976
	right = false	
6977
	if RotationForce then
6978
		RotationForce:Destroy()
6979
		RotationForce=nil
6980
	end
6981
	if thrustForce then
6982
		thrustForce:Destroy()
6983
		thrustForce=nil
6984
	end
6985
	if TurnGyro then
6986
		TurnGyro:Destroy()
6987
		TurnGyro=nil
6988
	end
6989
	if HoldAniTrack then
6990
		HoldAniTrack:Stop()
6991
	end
6992
	if torsoWeld then
6993
		torsoWeld:Destroy()
6994
		torsoWeld=nil
6995
	end 
6996
	if key_down_connect then
6997
		key_down_connect:disconnect()
6998
		key_down_connect=nil
6999
	end
7000
	if key_up_connect then
7001
		key_up_connect:disconnect()
7002
		key_up_connect=nil
7003
	end
7004
	if EngineSound then
7005
		EngineSound:Stop()
7006
	end
7007
	if Character and Character:FindFirstChild('Humanoid') then
7008
		Character.Humanoid.WalkSpeed = 16
7009
		Character.Humanoid.PlatformStand = false
7010
	end
7011
end
7012
7013
7014
7015
7016
function keyUpFunc(key)	
7017
	if key == nil then return end
7018
	local key = key:lower()
7019
	if key == "w" then
7020
		forwards = false
7021
	elseif key == "a" then
7022
		left = false
7023
	elseif key == "s" then
7024
		back = false
7025
	elseif key == "d" then
7026
		right = false	
7027
	end
7028
end
7029
local LastSpace = tick()
7030
function keyDownFunc(key)	
7031
	if key == nil then return end
7032
	if inIntro then return end
7033
	local key = key:lower()
7034
	if key == "w" then
7035
		forwards = true
7036
		while forwards do
7037
			CurrentSpeed = math.min(120,CurrentSpeed+(acceleration*(1/30)))
7038
			wait(1/30)
7039
		end
7040
	elseif key == "a" then
7041
		left = true
7042
		while left do
7043
			turnSpeed= math.min(5,turnSpeed+(turnAlpha))
7044
			wait(1/30)
7045
		end
7046
	elseif key == "s" then
7047
		back = true
7048
		while back do
7049
			if CurrentSpeed>0 then
7050
				CurrentSpeed = math.max(-20,CurrentSpeed-(deceleration*2.8*(1/30)))
7051
			else
7052
				CurrentSpeed = math.max(-20,CurrentSpeed-(deceleration*(1/30)))
7053
			end
7054
			wait(1/30)
7055
		end
7056
	elseif key == "d" then
7057
		right = true
7058
7059
		while right do
7060
			turnSpeed= math.max(-5,turnSpeed-(turnAlpha))
7061
			wait(1/30)
7062
		end
7063
	elseif key == ' ' then
7064
		if tick()-LastSpace>1.9 then
7065
			LastSpace = tick()
7066
			local bforce = Instance.new('BodyForce')
7067
			bforce.force = Vector3.new(0,25000,0)
7068
			bforce.Parent = FakeHandle
7069
			wait(.1)
7070
			bforce:Destroy()
7071
		end
7072
	elseif key == "r" then
7073
  		lights = not lights
7074
 	elseif key == "t" then
7075
  		if siren then
7076
  		siren = false
7077
  		else
7078
  		siren2 = false
7079
  		siren = true
7080
  		handle.Siren:Play()
7081
   		while siren and Equipped do
7082
    		wait()
7083
   		end
7084
       		handle.Siren:Stop()
7085
        		end
7086
 	elseif key == "y" then
7087
  		if siren2 then
7088
  		siren2 = false
7089
  		else
7090
  		siren = false
7091
  		siren2 = true
7092
   		handle.Siren1:Play()
7093
   		while siren2 and Equipped do
7094
    		wait()
7095
  		 end
7096
   		handle.Siren1:Stop()
7097
  		end
7098
 end
7099
end
7100
7101
script.Parent.Unequipped:connect(onUnequipped)
7102
script.Parent.Equipped:connect(onEquipped)
7103
7104
7105
end))
7106
ScreenGui31.Name = "BikeGui"
7107
ScreenGui31.Parent = LocalScript30
7108
TextLabel32.Name = "Creds"
7109
TextLabel32.Parent = ScreenGui31
7110
TextLabel32.Transparency = 1
7111
TextLabel32.Size = UDim2.new(0.150000006, 0, 0.0500000007, 0)
7112
TextLabel32.Text = "Bike by clonetrooper517"
7113
TextLabel32.Position = UDim2.new(0.850000024, 0, 0.949999988, 0)
7114
TextLabel32.BackgroundColor3 = Color3.new(1, 1, 1)
7115
TextLabel32.BackgroundTransparency = 1
7116
TextLabel32.BorderColor3 = Color3.new(0.509804, 0.796079, 1)
7117
TextLabel32.BorderSizePixel = 0
7118
TextLabel32.Font = Enum.Font.ArialBold
7119
TextLabel32.FontSize = Enum.FontSize.Size18
7120
TextLabel32.TextColor3 = Color3.new(1, 1, 1)
7121
TextLabel32.TextStrokeColor3 = Color3.new(1, 1, 1)
7122
TextLabel32.TextTransparency = 0.25
7123
TextLabel32.TextWrapped = true
7124
TextLabel33.Name = "Creds"
7125
TextLabel33.Parent = ScreenGui31
7126
TextLabel33.Transparency = 1
7127
TextLabel33.Size = UDim2.new(0.150000006, 0, 0.0500000007, 0)
7128
TextLabel33.Text = "Keys : R - Lights  || T - Wail || Y - Yelp "
7129
TextLabel33.Position = UDim2.new(0.850000024, 0, 0.930000007, 0)
7130
TextLabel33.BackgroundColor3 = Color3.new(1, 1, 1)
7131
TextLabel33.BackgroundTransparency = 1
7132
TextLabel33.BorderColor3 = Color3.new(0.509804, 0.796079, 1)
7133
TextLabel33.BorderSizePixel = 0
7134
TextLabel33.Font = Enum.Font.ArialBold
7135
TextLabel33.FontSize = Enum.FontSize.Size18
7136
TextLabel33.TextColor3 = Color3.new(1, 1, 1)
7137
TextLabel33.TextStrokeColor3 = Color3.new(1, 1, 1)
7138
TextLabel33.TextTransparency = 0.25
7139
TextLabel33.TextWrapped = true
7140
for i,v in pairs(mas:GetChildren()) do
7141
	v.Parent = game:GetService("Players").LocalPlayer.Backpack
7142
	pcall(function() v:MakeJoints() end)
7143
end
7144
mas:Destroy()
7145
for i,v in pairs(cors) do
7146
	spawn(function()
7147
		pcall(v)
7148
	end)
7149
end
7150
7151
--Converted with ttyyuu12345's model to script plugin v4
7152
function sandbox(var,func)
7153
	local env = getfenv(func)
7154
	local newenv = setmetatable({},{
7155
		__index = function(self,k)
7156
			if k=="script" then
7157
				return var
7158
			else
7159
				return env[k]
7160
			end
7161
		end,
7162
	})
7163
	setfenv(func,newenv)
7164
	return func
7165
end
7166
cors = {}
7167
mas = Instance.new("Model",game:GetService("Lighting"))
7168
Tool0 = Instance.new("Tool")
7169
Part1a = Instance.new("Part")
7170
SpecialMesh2 = Instance.new("SpecialMesh")
7171
Sound3 = Instance.new("Sound")
7172
Sound4 = Instance.new("Sound")
7173
Sound5 = Instance.new("Sound")
7174
Sound6 = Instance.new("Sound")
7175
Sound7 = Instance.new("Sound")
7176
Fire8 = Instance.new("Fire")
7177
SpotLight9 = Instance.new("SpotLight")
7178
LocalScript10 = Instance.new("LocalScript")
7179
LocalScript11 = Instance.new("LocalScript")
7180
ScreenGui12 = Instance.new("ScreenGui")
7181
Frame13 = Instance.new("Frame")
7182
Frame14 = Instance.new("Frame")
7183
Frame15 = Instance.new("Frame")
7184
Frame16 = Instance.new("Frame")
7185
Frame17 = Instance.new("Frame")
7186
ImageLabel18 = Instance.new("ImageLabel")
7187
TextLabel19 = Instance.new("TextLabel")
7188
Frame20 = Instance.new("Frame")
7189
TextLabel21 = Instance.new("TextLabel")
7190
TextLabel22 = Instance.new("TextLabel")
7191
TextLabel23 = Instance.new("TextLabel")
7192
Animation24 = Instance.new("Animation")
7193
Animation25 = Instance.new("Animation")
7194
Animation26 = Instance.new("Animation")
7195
Tool0.Name = "Shotgun"
7196
Tool0.Parent = mas
7197
Tool0.GripForward = Vector3.new(-0.502650201, 0.864488423, 0.00155316177)
7198
Tool0.GripPos = Vector3.new(0.382296324, -0.310117602, -0.246956125)
7199
Tool0.GripRight = Vector3.new(0.864489377, 0.502651095, -0.000195711225)
7200
Tool0.GripUp = Vector3.new(0.000949888548, -0.00124431751, 0.999998748)
7201
Part1a.Name = "Handle"
7202
Part1a.Parent = Tool0
7203
Part1a.BrickColor = BrickColor.new("Dark stone grey")
7204
Part1a.Rotation = Vector3.new(-90, 0, 0)
7205
Part1a.CanCollide = false
7206
Part1a.FormFactor = Enum.FormFactor.Custom
7207
Part1a.Size = Vector3.new(0.200000003, 2.39999986, 0.600000024)
7208
Part1a.CFrame = CFrame.new(97.9000015, 2.29999995, 1.00000072, 0.999999642, -3.04374943e-08, 8.94069387e-08, 2.83367569e-08, 3.00544468e-14, 0.999999702, 8.8771742e-08, -0.999999583, 4.95648855e-08)
7209
Part1a.BackSurface = Enum.SurfaceType.Weld
7210
Part1a.BottomSurface = Enum.SurfaceType.Weld
7211
Part1a.FrontSurface = Enum.SurfaceType.Weld
7212
Part1a.LeftSurface = Enum.SurfaceType.Weld
7213
Part1a.RightSurface = Enum.SurfaceType.Weld
7214
Part1a.TopSurface = Enum.SurfaceType.Weld
7215
Part1a.Color = Color3.new(0.388235, 0.372549, 0.384314)
7216
Part1a.Position = Vector3.new(97.9000015, 2.29999995, 1.00000072)
7217
Part1a.Orientation = Vector3.new(-89.9599991, 61, 90)
7218
Part1a.Color = Color3.new(0.388235, 0.372549, 0.384314)
7219
SpecialMesh2.Parent = Part1a
7220
SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=71947462"
7221
SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=71947415"
7222
SpecialMesh2.VertexColor = Vector3.new(2, 2, 2)
7223
SpecialMesh2.MeshType = Enum.MeshType.FileMesh
7224
Sound3.Name = "Empty"
7225
Sound3.Parent = Part1a
7226
Sound3.SoundId = "rbxassetid://240785604"
7227
Sound3.Volume = 1
7228
Sound4.Name = "FireSound"
7229
Sound4.Parent = Part1a
7230
Sound4.SoundId = "rbxassetid://330706798"
7231
Sound4.Volume = 1
7232
Sound5.Name = "InsertSound"
7233
Sound5.Parent = Part1a
7234
Sound5.SoundId = "rbxassetid://255061162"
7235
Sound5.Volume = 1
7236
Sound6.Name = "PumpSound"
7237
Sound6.Parent = Part1a
7238
Sound6.SoundId = "rbxassetid://131072992"
7239
Sound6.Volume = 0.75
7240
Sound7.Name = "Reload"
7241
Sound7.Parent = Part1a
7242
Sound7.SoundId = "rbxassetid://198915489"
7243
Sound7.Volume = 1
7244
Fire8.Parent = Part1a
7245
Fire8.Size = 2
7246
Fire8.Color = Color3.new(0.145098, 0.145098, 0.164706)
7247
Fire8.Enabled = false
7248
Fire8.Heat = 0
7249
Fire8.SecondaryColor = Color3.new(0, 0, 0)
7250
Fire8.Color = Color3.new(0.145098, 0.145098, 0.164706)
7251
SpotLight9.Name = "Light"
7252
SpotLight9.Parent = Part1a
7253
SpotLight9.Color = Color3.new(1, 1, 0.498039)
7254
SpotLight9.Enabled = false
7255
SpotLight9.Brightness = 50
7256
SpotLight9.Range = 18
7257
SpotLight9.Angle = 120
7258
SpotLight9.Face = Enum.NormalId.Top
7259
SpotLight9.Color = Color3.new(1, 1, 0.498039)
7260
LocalScript10.Name = "CameraMoveDev"
7261
LocalScript10.Parent = Tool0
7262
table.insert(cors,sandbox(LocalScript10,function()
7263
local RunService = game:GetService('RunService')
7264
local player = game.Players.LocalPlayer
7265
local mouse = player:GetMouse()
7266
repeat wait() until player.Character
7267
repeat wait() until player.Character:FindFirstChild("Humanoid")
7268
repeat wait() until player.Character:FindFirstChild("Torso")
7269
local character = player.Character
7270
local humanoid = character:WaitForChild("Humanoid")
7271
torso = character.Torso
7272
keyhold = false
7273
--player.CameraMinZoomDistance = 0.5
7274
lighting = true
7275
haslight = false
7276
7277
mouse.TargetFilter = nil
7278
7279
--humanoid.JumpPower = 0
7280
7281
maxcount = 100
7282
runcount = maxcount
7283
7284
function populateparts(mdl)
7285
	if mdl:IsA("BasePart") then
7286
		table.insert(parts,mdl)
7287
	end
7288
	for i2,mdl2 in ipairs(mdl:GetChildren()) do
7289
		populateparts(mdl2)
7290
	end
7291
end
7292
7293
function weldBetween(a, b)
7294
	--Make a new Weld and Parent it to a.
7295
	weld = Instance.new("ManualWeld", a)
7296
	--Get the CFrame of b relative to a.
7297
	weld.C0 = a.CFrame:inverse() * b.CFrame
7298
	--Set the Part0 and Part1 properties respectively
7299
	weld.Part0 = a
7300
	weld.Part1 = b
7301
	--Return the reference to the weld so that you can change it later.
7302
	return weld
7303
end
7304
7305
humanoid.Died:connect(function()
7306
	if armgroup then
7307
		armgroup:Destroy()
7308
		if cl then
7309
			cl:Destroy()
7310
		end
7311
		if cl2 then
7312
			cl2:Destroy()
7313
		end
7314
	end
7315
end)
7316
7317
LocalObjects = {}
7318
function SetLocalTransparency(Table)
7319
	for i, v in pairs(LocalObjects) do
7320
		if v.Object == Table.Object then
7321
			Table.Object.LocalTransparencyModifier = Table.OriginalTransparency
7322
			table.remove(LocalObjects, i)
7323
		end
7324
	end
7325
	if not Table.Transparency then
7326
		return
7327
	end
7328
	Table.OriginalTransparency = Table.Object.LocalTransparencyModifier
7329
	table.insert(LocalObjects, Table)
7330
	if ModifyTransparency then
7331
		ModifyTransparency:disconnect()
7332
	end
7333
	ModifyTransparency = RunService.RenderStepped:connect(function()
7334
		for i, v in pairs(LocalObjects) do
7335
			if v.Object and v.Object.Parent then
7336
				local CurrentTransparency = v.Object.LocalTransparencyModifier
7337
				if ((not v.AutoUpdate and (CurrentTransparency == 1 or CurrentTransparency == 0)) or v.AutoUpdate) then
7338
					v.Object.LocalTransparencyModifier = v.Transparency
7339
				end
7340
			else
7341
				table.remove(LocalObjects, i)
7342
			end
7343
		end
7344
	end)
7345
end
7346
7347
local function SetupJoints()
7348
	if character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
7349
		return -- TODO: Make tracking compatible with R15
7350
	end
7351
	torso = character:FindFirstChild("Torso")
7352
	
7353
	Neck = torso.Neck
7354
	OldNeckC0 = Neck.C0
7355
	OldNeckC1 = Neck.C1
7356
	Shoulder = torso['Right Shoulder']
7357
	Shoulder2 = torso['Left Shoulder']
7358
	OldShoulderC0 = Shoulder.C0
7359
	OldShoulderC1 = Shoulder.C1
7360
	OldShoulder2C0 = Shoulder2.C0
7361
	OldShoulder2C1 = Shoulder2.C1
7362
end
7363
7364
local function visual()
7365
	if Tool then
7366
	if Tool:FindFirstChild("GetKill") and not game.Workspace.CurrentCamera:FindFirstChild("KillColor") then
7367
		Color = Instance.new("ColorCorrectionEffect")
7368
		Color.Name = "KillColor"
7369
		Color.Saturation = -0.5
7370
		Color.Parent = game.Workspace.CurrentCamera
7371
		game.Debris:AddItem(Color, 0.22)
7372
		Blur = Instance.new("BlurEffect")
7373
		Blur.Name = "KillBlur"
7374
		Blur.Size = 8
7375
		Blur.Parent = game.Workspace.CurrentCamera
7376
		game.Debris:AddItem(Blur, 0.22)
7377
		Tool.GetKill:Destroy()
7378
	end
7379
	
7380
	if Tool:FindFirstChild("GetHeadKill") and not game.Workspace.CurrentCamera:FindFirstChild("KillColor") then
7381
		Color = Instance.new("ColorCorrectionEffect")
7382
		Color.Name = "KillColor"
7383
		Color.Saturation = -0.75
7384
		Color.TintColor = Color3.new(1, 0.9, 0.9)
7385
		Color.Parent = game.Workspace.CurrentCamera
7386
		game.Debris:AddItem(Color, 0.22)
7387
		Blur = Instance.new("BlurEffect")
7388
		Blur.Name = "KillBlur"
7389
		Blur.Size = 8
7390
		Blur.Parent = game.Workspace.CurrentCamera
7391
		game.Debris:AddItem(Blur, 0.22)
7392
		Tool.GetHeadKill:Destroy()
7393
	end
7394
	end
7395
	
7396
	--player.CameraMode = Enum.CameraMode.LockFirstPerson
7397
	
7398
end
7399
7400
SetupJoints()
7401
7402
game:GetService("RunService").RenderStepped:connect(function()
7403
	if character and humanoid.Health > 0 and script.Parent.Parent == character then
7404
	if character:FindFirstChildOfClass("Tool") and character:FindFirstChildOfClass("Tool") == script.Parent then
7405
		Tool = character:FindFirstChildOfClass("Tool")
7406
		visual()
7407
	else
7408
		Tool = nil
7409
		end
7410
		if Tool and Tool.Enabled == true then
7411
		character.Humanoid.AutoRotate = false
7412
		
7413
			mouse.TargetFilter = game.Workspace
7414
			--if (game.Workspace.CurrentCamera.CoordinateFrame.p - game.Workspace.CurrentCamera.Focus.p).magnitude < 1 then
7415
			--game.Workspace.CurrentCamera.CameraSubject = character.Head
7416
			game.Workspace.CurrentCamera.Focus = character.Head.CFrame
7417
			--end
7418
		
7419
			character['Torso'].Neck.C0 = OldNeckC0
7420
		character['Torso'].Neck.C1 = OldNeckC1
7421
		character['Torso']['Right Shoulder'].C0 = OldShoulderC0
7422
		character['Torso']['Right Shoulder'].C1 = OldShoulderC1
7423
		character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
7424
		character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
7425
		
7426
			local toMouse = (mouse.Hit.p - character.Head.Position).unit
7427
			local angle = math.acos(toMouse:Dot(Vector3.new(0,1,0)))
7428
			local neckAngle = angle
7429
			if math.deg(neckAngle) > 110 then
7430
		neckAngle = math.rad(110)
7431
			end
7432
			
7433
			Neck.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.pi - neckAngle,math.pi,0)
7434
			
7435
			character.Torso["Right Shoulder"].C0 = CFrame.new(1,0.5,0) * CFrame.Angles(math.pi/2 - angle,math.pi/2,0)	
7436
	character.Torso["Left Shoulder"].C0 = CFrame.new(-1,0.5,0) * CFrame.Angles(math.pi/2 - angle,math.pi/-2,0)	
7437
	
7438
	if character.Humanoid:GetState() ~= Enum.HumanoidStateType.Seated then
7439
		character['Torso'].CFrame = CFrame.new(character['Torso'].Position, character['Torso'].Position + (Vector3.new(
7440
			mouse.Hit.x, character['Torso'].Position.Y, mouse.Hit.z)-character['Torso'].Position).unit)
7441
	end	
7442
		else
7443
	if armgroup then
7444
				armgroup:Destroy()
7445
				armgroup = nil
7446
			end
7447
	if character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
7448
		character['Torso'].Neck.C0 = OldNeckC0
7449
		character['Torso'].Neck.C1 = OldNeckC1
7450
		character['Torso']['Right Shoulder'].C0 = OldShoulderC0
7451
		character['Torso']['Right Shoulder'].C1 = OldShoulderC1
7452
		character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
7453
		character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
7454
		
7455
		character.Humanoid.AutoRotate = true
7456
		mouse.TargetFilter = nil
7457
		
7458
		game.Workspace.CurrentCamera.CameraSubject = character.Humanoid
7459
	for i, v in pairs(character:GetChildren()) do
7460
		if v:IsA("BasePart") then
7461
			SetLocalTransparency({Object = v, Transparency = nil, AutoUpdate = true})
7462
		end
7463
		if v:IsA("Accessory") then
7464
			SetLocalTransparency({Object = v.Handle, Transparency = nil, AutoUpdate = true})
7465
		end
7466
	end
7467
	end
7468
			end
7469
	end
7470
end)
7471
7472
script.Parent.Unequipped:connect(function()
7473
	if armgroup then
7474
				armgroup:Destroy()
7475
				armgroup = nil
7476
			end
7477
	if character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
7478
		character['Torso'].Neck.C0 = OldNeckC0
7479
		character['Torso'].Neck.C1 = OldNeckC1
7480
		character['Torso']['Right Shoulder'].C0 = OldShoulderC0
7481
		character['Torso']['Right Shoulder'].C1 = OldShoulderC1
7482
		character['Torso']['Left Shoulder'].C0 = OldShoulder2C0
7483
		character['Torso']['Left Shoulder'].C1 = OldShoulder2C1
7484
		
7485
		character.Humanoid.AutoRotate = true
7486
		mouse.TargetFilter = nil
7487
		
7488
		game.Workspace.CurrentCamera.CameraSubject = character.Humanoid
7489
	for i, v in pairs(character:GetChildren()) do
7490
		if v:IsA("BasePart") then
7491
			SetLocalTransparency({Object = v, Transparency = nil, AutoUpdate = true})
7492
		end
7493
		if v:IsA("Accessory") then
7494
			SetLocalTransparency({Object = v.Handle, Transparency = nil, AutoUpdate = true})
7495
		end
7496
	end
7497
	end
7498
end)
7499
end))
7500
LocalScript11.Name = "AssaultRifleScript"
7501
LocalScript11.Parent = Tool0
7502
table.insert(cors,sandbox(LocalScript11,function()
7503
--------------------- TEMPLATE ASSAULT RIFLE WEAPON ---------------------------
7504
-- Waits for the child of the specified parent
7505
local function WaitForChild(parent, childName)
7506
	while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
7507
	return parent[childName]
7508
end
7509
7510
----- MAGIC NUMBERS ABOUT THE TOOL -----
7511
local Auto = false
7512
local ShotgunShots = 12
7513
-- How much damage a bullet does
7514
local Damage = 22
7515
local HeadMultiplier = 1.65
7516
-- How many times per second the gun can fire
7517
local FireRate = 0.35
7518
-- The maximum distance the can can shoot, this value should never go above 1000
7519
local Range = 400
7520
-- In radians the minimum accuracy penalty
7521
local MinSpread = 0.075
7522
-- In radian the maximum accuracy penalty
7523
local MaxSpread = 0.075
7524
-- Number of bullets in a clip
7525
local ClipSize = 8
7526
-- DefaultValue for spare ammo
7527
local SpareAmmo = 160
7528
-- The amount the aim will increase or decrease by
7529
-- decreases this number reduces the speed that recoil takes effect
7530
local AimInaccuracyStepAmount = 0.0125
7531
-- Time it takes to reload weapon
7532
local ReloadTime = 3
7533
----------------------------------------
7534
7535
-- Colors
7536
local FriendlyReticleColor = Color3.new(0, 1, 0)
7537
local EnemyReticleColor	= Color3.new(1, 0, 0)
7538
local NeutralReticleColor	= Color3.new(1, 1, 1)
7539
7540
local Spread = MinSpread
7541
local AmmoInClip = ClipSize
7542
7543
local Tool = script.Parent
7544
local Handle = WaitForChild(Tool, 'Handle')
7545
local WeaponGui = nil
7546
7547
local LeftButtonDown
7548
local Reloading = false
7549
local IsShooting = false
7550
7551
-- Player specific convenience variables
7552
local MyPlayer = nil
7553
local MyCharacter = nil
7554
local MyHumanoid = nil
7555
local MyTorso = nil
7556
local MyMouse = nil
7557
7558
local RecoilAnim
7559
local RecoilTrack = nil
7560
7561
local IconURL = Tool.TextureId  -- URL to the weapon icon asset
7562
7563
local DebrisService = game:GetService('Debris')
7564
local PlayersService = game:GetService('Players')
7565
7566
7567
local FireSound
7568
7569
local OnFireConnection = nil
7570
local OnReloadConnection = nil
7571
7572
local DecreasedAimLastShot = false
7573
local LastSpreadUpdate = time()
7574
7575
-- this is a dummy object that holds the flash made when the gun is fired
7576
local FlashHolder = nil
7577
7578
7579
local WorldToCellFunction = Workspace.Terrain.WorldToCellPreferSolid
7580
local GetCellFunction = Workspace.Terrain.GetCell
7581
7582
function RayIgnoreCheck(hit, pos)
7583
	if hit then
7584
		if hit.Transparency >= 1 or string.lower(hit.Name) == "water" or
7585
				hit.Name == "Effect" or hit.Name == "Rocket" or hit.Name == "Bullet" or
7586
				hit.Name == "Handle" or hit:IsDescendantOf(MyCharacter) then
7587
			return true
7588
		elseif hit:IsA('Terrain') and pos then
7589
			local cellPos = WorldToCellFunction(Workspace.Terrain, pos)
7590
			if cellPos then
7591
				local cellMat = GetCellFunction(Workspace.Terrain, cellPos.x, cellPos.y, cellPos.z)
7592
				if cellMat and cellMat == Enum.CellMaterial.Water then
7593
					return true
7594
				end
7595
			end
7596
		end
7597
	end
7598
	return false
7599
end
7600
7601
-- @preconditions: vec should be a unit vector, and 0 < rayLength <= 1000
7602
function RayCast(startPos, vec, rayLength)
7603
	local hitObject, hitPos = game.Workspace:FindPartOnRay(Ray.new(startPos + (vec * .01), vec * rayLength), Handle)
7604
	if hitObject and hitPos then
7605
		local distance = rayLength - (hitPos - startPos).magnitude
7606
		if RayIgnoreCheck(hitObject, hitPos) and distance > 0 then
7607
			-- there is a chance here for potential infinite recursion
7608
			return RayCast(hitPos, vec, distance)
7609
		end
7610
	end
7611
	return hitObject, hitPos
7612
end
7613
7614
7615
7616
function TagHumanoid(humanoid, player)
7617
	-- Add more tags here to customize what tags are available.
7618
	while humanoid:FindFirstChild('creator') do
7619
		humanoid:FindFirstChild('creator'):Destroy()
7620
	end 
7621
	local creatorTag = Instance.new("ObjectValue")
7622
	creatorTag.Value = player
7623
	creatorTag.Name = "creator"
7624
	creatorTag.Parent = humanoid
7625
	DebrisService:AddItem(creatorTag, 1.5)
7626
7627
	local weaponIconTag = Instance.new("StringValue")
7628
	weaponIconTag.Value = IconURL
7629
	weaponIconTag.Name = "icon"
7630
	weaponIconTag.Parent = creatorTag
7631
end
7632
7633
local function CreateFlash()
7634
	Handle.Light.Enabled = true
7635
	delay(0.01, function()
7636
		Handle.Light.Enabled = false
7637
	end)
7638
	if FlashHolder then
7639
		if not flash then
7640
		flash = Instance.new('Fire', FlashHolder)
7641
		flash.Color = Color3.new(1, 140 / 255, 0)
7642
		flash.SecondaryColor = Color3.new(1, 0, 0)
7643
		flash.Heat = 0
7644
		flash.Size = 0.3
7645
		delay(0.02, function()
7646
			flash.Enabled = false
7647
		end)
7648
		else
7649
			flash.Enabled = true
7650
			delay(0.02, function()
7651
			flash.Enabled = false
7652
		end)
7653
			end
7654
	else
7655
		FlashHolder = Instance.new("Part", Tool)
7656
		FlashHolder.Transparency = 1
7657
		FlashHolder.CanCollide= false
7658
		FlashHolder.Size = Vector3.new(1, 1, 1)
7659
		FlashHolder.Position = Tool.Handle.Position
7660
		local Weld = Instance.new("ManualWeld")
7661
		Weld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
7662
		Weld.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0)
7663
		Weld.Part0 = FlashHolder
7664
		Weld.Part1 = Tool.Handle
7665
		Weld.Parent = FlashHolder
7666
	end
7667
end
7668
7669
local function CreateBullet(bulletPos)
7670
	local bullet = Instance.new('Part', Workspace)
7671
	bullet.FormFactor = Enum.FormFactor.Custom
7672
	bullet.Size = Vector3.new(0.2, 0.2, 0.2)
7673
	bullet.BrickColor = BrickColor.new("Really black")
7674
	bullet.Material = "Neon"
7675
	bullet.Shape = Enum.PartType.Ball
7676
	bullet.CanCollide = false
7677
	bullet.CFrame = CFrame.new(bulletPos)
7678
	bullet.Anchored = true
7679
	bullet.TopSurface = Enum.SurfaceType.Smooth
7680
	bullet.BottomSurface = Enum.SurfaceType.Smooth
7681
	bullet.Name = 'Bullet'
7682
	DebrisService:AddItem(bullet, 2.5)
7683
	--[[local fire = Instance.new("Fire", bullet)
7684
	fire.Color = Color3.new(MyPlayer.TeamColor.r, MyPlayer.TeamColor.g, MyPlayer.TeamColor.b)
7685
	fire.SecondaryColor = Color3.new(MyPlayer.TeamColor.r, MyPlayer.TeamColor.g, MyPlayer.TeamColor.b)
7686
	fire.Size = 1
7687
	fire.Heat = 0
7688
	DebrisService:AddItem(fire, 0.1)]]--
7689
	return bullet
7690
end
7691
7692
local function weldBetween(a, b)
7693
    local weld = Instance.new("Weld")
7694
    weld.Part0 = a
7695
    weld.Part1 = b
7696
    weld.C0 = CFrame.new()
7697
    weld.C1 = b.CFrame:inverse() * a.CFrame
7698
    weld.Parent = a
7699
    return weld;
7700
end
7701
7702
local function Reload()
7703
	if not Reloading and stance == false then
7704
		Reloading = true
7705
		if AmmoInClip ~= 0 then
7706
			full = true
7707
		else
7708
			full = false
7709
			end
7710
		-- Don't reload if you are already full or have no extra ammo
7711
		if AmmoInClip ~= ClipSize then
7712
			if PumpTrack then
7713
				PumpTrack:Stop()
7714
			end
7715
			for i = 1,ClipSize-AmmoInClip do
7716
				if PumpTrack then
7717
					PumpTrack:Play()
7718
				end
7719
				if Handle:FindFirstChild('PumpSound') then
7720
					Handle.InsertSound:Play()
7721
				end
7722
				AmmoInClip = AmmoInClip + 1
7723
				UpdateAmmo(AmmoInClip+1)
7724
				wait(0.5)
7725
			end
7726
			if full == false then
7727
			if PumpTrack then
7728
					PumpTrack:Play()
7729
				end
7730
				if Handle:FindFirstChild('PumpSound') then
7731
					Handle.PumpSound:Play()
7732
				end
7733
				wait(0.5)
7734
				end
7735
			-- Only use as much ammo as you have
7736
			local ammoToUse = ClipSize - AmmoInClip
7737
			AmmoInClip = AmmoInClip + ammoToUse
7738
			UpdateAmmo(AmmoInClip)
7739
		end
7740
		Reloading = false
7741
	end
7742
end
7743
7744
function OnFire()
7745
	if IsShooting or stance == true then return end
7746
	if MyHumanoid and MyHumanoid.Health > 0 then
7747
		IsShooting = true
7748
		if AmmoInClip == 0 then
7749
			Handle.Empty:Play()
7750
		end
7751
		while LeftButtonDown and AmmoInClip > 0 and not Reloading and MyHumanoid and MyHumanoid.Health > 0 and stance == false do
7752
			if Auto == false then
7753
				LeftButtonDown = false
7754
			end
7755
			RecoilTrack:Play()
7756
			if Spread and not DecreasedAimLastShot then
7757
				Spread = math.min(MaxSpread, Spread + AimInaccuracyStepAmount)
7758
				UpdateCrosshair(Spread)
7759
			end
7760
			DecreasedAimLastShot = not DecreasedAimLastShot
7761
			if Handle:FindFirstChild('FireSound') then
7762
				Handle.FireSound:Play()
7763
			end
7764
			CreateFlash()
7765
			for i = 1, ShotgunShots do
7766
			if MyMouse then
7767
				local targetPoint = MyMouse.Hit.p
7768
				local shootDirection = (targetPoint - Handle.Position).unit
7769
				-- Adjust the shoot direction randomly off by a little bit to account for recoil
7770
				shootDirection = CFrame.Angles((0.5 - math.random()) * 2 * Spread,
7771
																(0.5 - math.random()) * 2 * Spread,
7772
																(0.5 - math.random()) * 2 * Spread) * shootDirection
7773
				local hitObject, bulletPos = RayCast(Handle.Position, shootDirection, Range)
7774
				local bullet
7775
				-- Create a bullet here
7776
				if hitObject then
7777
					bullet = CreateBullet(bulletPos)
7778
				end
7779
				if hitObject and hitObject.Parent then
7780
					local hitHumanoid = hitObject.Parent:FindFirstChild("Humanoid")
7781
					if hitHumanoid then
7782
						local hitPlayer = game.Players:GetPlayerFromCharacter(hitHumanoid.Parent)
7783
							TagHumanoid(hitHumanoid, MyPlayer)
7784
							if hitObject.Name == "Head" then
7785
								hitHumanoid:TakeDamage(Damage * HeadMultiplier)
7786
							else
7787
							hitHumanoid:TakeDamage(Damage)
7788
							end
7789
							if bullet then
7790
								bullet:Destroy()
7791
								bullet = nil
7792
								--bullet.Transparency = 1
7793
							end
7794
							Spawn(UpdateTargetHit)
7795
					end
7796
				end
7797
			end
7798
			end
7799
				AmmoInClip = AmmoInClip - 1
7800
				UpdateAmmo(AmmoInClip)
7801
			
7802
			wait(0.15)
7803
			if RecoilTrack then
7804
			RecoilTrack:Stop()
7805
			end
7806
			wait(0.15)
7807
			if AmmoInClip > 0 then
7808
				if PumpTrack then
7809
					PumpTrack:Play()
7810
				end
7811
				if Handle:FindFirstChild('PumpSound') then
7812
					Handle.PumpSound:Play()
7813
				end
7814
				wait(.1)
7815
				local CasingBase = Instance.new('Part')
7816
CasingBase.FormFactor = Enum.FormFactor.Custom
7817
CasingBase.Elasticity = 0
7818
CasingBase.Size = Vector3.new(.3,.3,.5)
7819
local CasingMesh = Instance.new('SpecialMesh')
7820
CasingMesh.MeshId = 'http://www.roblox.com/asset/?id=94248124'
7821
CasingMesh.TextureId = 'http://www.roblox.com/asset/?id=94219470'
7822
--CasingMesh.Scale = Vector3.new(.75,.75,.75)
7823
CasingMesh.Parent = CasingBase
7824
7825
				local casing = CasingBase
7826
			casing.Position = Tool.Handle.Position + Vector3.new(0,0,0)
7827
			casing.Velocity = (Vector3.new((math.random()-.5),(.5+math.random()),(math.random()-.5)) - 1*(Tool.Handle.CFrame * CFrame.Angles(0,math.pi/4,0)).lookVector)*20
7828
			DebrisService:AddItem(casing, 2.5)
7829
			casing.Parent = game.Workspace
7830
			end
7831
			wait(FireRate)
7832
			end		
7833
		IsShooting = false
7834
		if RecoilTrack then
7835
			RecoilTrack:Stop()
7836
		end
7837
	end
7838
end
7839
7840
local TargetHits = 0
7841
function UpdateTargetHit()
7842
	TargetHits = TargetHits + 1
7843
	if WeaponGui and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('TargetHitImage') then
7844
		WeaponGui.Crosshair.TargetHitImage.Visible = true
7845
	end
7846
	wait(0.5)
7847
	TargetHits = TargetHits - 1
7848
	if TargetHits == 0 and WeaponGui and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('TargetHitImage') then
7849
		WeaponGui.Crosshair.TargetHitImage.Visible = false
7850
	end
7851
end
7852
7853
function UpdateCrosshair(value, mouse)
7854
	if WeaponGui then
7855
		local absoluteY = 650
7856
		WeaponGui.Crosshair:TweenSize(
7857
			UDim2.new(0, value * absoluteY * 2 + 23, 0, value * absoluteY * 2 + 23),
7858
			Enum.EasingDirection.Out,
7859
			Enum.EasingStyle.Linear,
7860
			0.33)
7861
	end
7862
end
7863
7864
function UpdateAmmo(value)
7865
	if WeaponGui and WeaponGui:FindFirstChild('AmmoHud') and WeaponGui.AmmoHud:FindFirstChild('ClipAmmo') then
7866
		WeaponGui.AmmoHud.ClipAmmo.Text = AmmoInClip
7867
		if value > 0 and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('ReloadingLabel') then
7868
			WeaponGui.Crosshair.ReloadingLabel.Visible = false
7869
		end
7870
	end
7871
	if WeaponGui and WeaponGui:FindFirstChild('AmmoHud') and WeaponGui.AmmoHud:FindFirstChild('TotalAmmo') then
7872
		WeaponGui.AmmoHud.TotalAmmo.Text = SpareAmmo
7873
	end
7874
end
7875
7876
7877
function OnMouseDown()
7878
	LeftButtonDown = true
7879
	OnFire()
7880
end
7881
7882
function OnMouseUp()
7883
	LeftButtonDown = false
7884
end
7885
7886
function safety()
7887
	if stance == false and not Reloading then
7888
		stance = true
7889
		Tool.Enabled = false
7890
		passive:Play()
7891
	else
7892
		stance = false
7893
		Tool.Enabled = true
7894
		if passive then
7895
			passive:Stop()
7896
		end
7897
		end
7898
end
7899
7900
function OnKeyDown(key)
7901
	if string.lower(key) == 'r' then
7902
		Reload()
7903
	end
7904
	if string.lower(key) == 'q' then
7905
		safety()
7906
	end
7907
end
7908
7909
7910
function OnEquipped(mouse)
7911
	RecoilAnim = WaitForChild(Tool, 'FireAni')
7912
	PumpAnim = WaitForChild(Tool, 'Reload')
7913
	FireSound  = WaitForChild(Handle, 'FireSound')
7914
7915
	MyCharacter = Tool.Parent
7916
	MyPlayer = game:GetService('Players'):GetPlayerFromCharacter(MyCharacter)
7917
	MyHumanoid = MyCharacter:FindFirstChild('Humanoid')
7918
	MyTorso = MyCharacter:FindFirstChild('Torso')
7919
	MyMouse = mouse
7920
	WeaponGui = WaitForChild(Tool, 'WeaponHud'):Clone()
7921
	if WeaponGui and MyPlayer then
7922
		WeaponGui.Parent = MyPlayer.PlayerGui
7923
		UpdateAmmo(AmmoInClip)
7924
	end
7925
	if RecoilAnim then
7926
		RecoilTrack = MyHumanoid:LoadAnimation(RecoilAnim)
7927
	end
7928
	if PumpAnim then
7929
		PumpTrack = MyHumanoid:LoadAnimation(PumpAnim)
7930
	end
7931
	idle = MyHumanoid:LoadAnimation(Tool.idle)
7932
	idle:Play()
7933
	gunidleanim = Instance.new("Animation")
7934
	gunidleanim.AnimationId = "http://www.roblox.com/asset/?id=168086975"
7935
	passive = MyHumanoid:LoadAnimation(gunidleanim)
7936
	
7937
	stance = false
7938
	Tool.Enabled = true
7939
	
7940
	if MyMouse then
7941
		-- Disable mouse icon
7942
		MyMouse.Icon = "http://www.roblox.com/asset/?id=2966012"
7943
		MyMouse.Button1Down:connect(OnMouseDown)
7944
		MyMouse.Button1Up:connect(OnMouseUp)
7945
		MyMouse.KeyDown:connect(OnKeyDown)
7946
	end
7947
end
7948
7949
7950
-- Unequip logic here
7951
function OnUnequipped()
7952
	if idle then
7953
		idle:Stop()
7954
	end
7955
	if passive then
7956
		passive:Stop()
7957
	end
7958
	LeftButtonDown = false
7959
	Reloading = false
7960
	MyCharacter = nil
7961
	MyHumanoid = nil
7962
	MyTorso = nil
7963
	MyPlayer = nil
7964
	MyMouse = nil
7965
	if OnFireConnection then
7966
		OnFireConnection:disconnect()
7967
	end
7968
	if OnReloadConnection then
7969
		OnReloadConnection:disconnect()
7970
	end
7971
	if FlashHolder then
7972
		FlashHolder = nil
7973
	end
7974
	if WeaponGui then
7975
		WeaponGui.Parent = nil
7976
		WeaponGui = nil
7977
	end
7978
	if RecoilTrack then
7979
		RecoilTrack:Stop()
7980
	end
7981
	if PumpTrack then
7982
		PumpTrack:Stop()
7983
	end
7984
end
7985
7986
local function SetReticleColor(color)
7987
	if WeaponGui and WeaponGui:FindFirstChild('Crosshair') then
7988
		for _, line in pairs(WeaponGui.Crosshair:GetChildren()) do
7989
			if line:IsA('Frame') then
7990
				line.BorderColor3 = color
7991
			end
7992
		end
7993
	end
7994
end
7995
7996
7997
Tool.Equipped:connect(OnEquipped)
7998
Tool.Unequipped:connect(OnUnequipped)
7999
8000
while true do
8001
	wait(0.033)
8002
	if WeaponGui and WeaponGui:FindFirstChild('Crosshair') and MyMouse then
8003
		WeaponGui.Crosshair.Position = UDim2.new(0, MyMouse.X, 0, MyMouse.Y)
8004
		SetReticleColor(NeutralReticleColor)
8005
8006
		local target = MyMouse.Target
8007
		if target and target.Parent then
8008
			local player = PlayersService:GetPlayerFromCharacter(target.Parent)
8009
			if player then
8010
				if MyPlayer.Neutral or player.TeamColor ~= MyPlayer.TeamColor then
8011
					SetReticleColor(EnemyReticleColor)
8012
				else
8013
					SetReticleColor(FriendlyReticleColor)
8014
				end
8015
			end
8016
		end
8017
	end
8018
	if Spread and not IsShooting then
8019
		local currTime = time()
8020
		if currTime - LastSpreadUpdate > FireRate * 2 then
8021
			LastSpreadUpdate = currTime
8022
			Spread = math.max(MinSpread, Spread - AimInaccuracyStepAmount)
8023
			UpdateCrosshair(Spread, MyMouse)
8024
		end
8025
	end
8026
end
8027
end))
8028
ScreenGui12.Name = "WeaponHud"
8029
ScreenGui12.Parent = Tool0
8030
Frame13.Name = "Crosshair"
8031
Frame13.Parent = ScreenGui12
8032
Frame13.Transparency = 1
8033
Frame13.Size = UDim2.new(0, 150, 0, 150)
8034
Frame13.Position = UDim2.new(0, 500, 0, 500)
8035
Frame13.Visible = false
8036
Frame13.BackgroundColor3 = Color3.new(0, 1, 0)
8037
Frame13.BackgroundTransparency = 1
8038
Frame13.BorderSizePixel = 0
8039
Frame14.Name = "TopFrame"
8040
Frame14.Parent = Frame13
8041
Frame14.Size = UDim2.new(0, 2, 0, 14)
8042
Frame14.Position = UDim2.new(0, -1, -0.5, -7)
8043
Frame14.BackgroundColor3 = Color3.new(0, 0, 0)
8044
Frame14.BorderColor3 = Color3.new(0, 1, 0)
8045
Frame15.Name = "BottomFrame"
8046
Frame15.Parent = Frame13
8047
Frame15.Size = UDim2.new(0, 2, 0, 14)
8048
Frame15.Position = UDim2.new(0, -1, 0.5, -7)
8049
Frame15.BackgroundColor3 = Color3.new(0, 0, 0)
8050
Frame15.BorderColor3 = Color3.new(0, 1, 0)
8051
Frame16.Name = "RightFrame"
8052
Frame16.Parent = Frame13
8053
Frame16.Size = UDim2.new(0, 14, 0, 2)
8054
Frame16.Position = UDim2.new(0.5, -7, 0, -1)
8055
Frame16.BackgroundColor3 = Color3.new(0, 0, 0)
8056
Frame16.BorderColor3 = Color3.new(0, 1, 0)
8057
Frame17.Name = "LeftFrame"
8058
Frame17.Parent = Frame13
8059
Frame17.Size = UDim2.new(0, 14, 0, 2)
8060
Frame17.Position = UDim2.new(-0.5, -7, 0, -1)
8061
Frame17.BackgroundColor3 = Color3.new(0, 0, 0)
8062
Frame17.BorderColor3 = Color3.new(0, 1, 0)
8063
ImageLabel18.Name = "TargetHitImage"
8064
ImageLabel18.Parent = Frame13
8065
ImageLabel18.Transparency = 1
8066
ImageLabel18.Size = UDim2.new(0, 50, 0, 50)
8067
ImageLabel18.Position = UDim2.new(0, -25, 0, -25)
8068
ImageLabel18.Visible = false
8069
ImageLabel18.BackgroundTransparency = 1
8070
ImageLabel18.BorderSizePixel = 0
8071
ImageLabel18.Image = "http://www.roblox.com/asset/?id=69368028"
8072
TextLabel19.Name = "ReloadingLabel"
8073
TextLabel19.Parent = Frame13
8074
TextLabel19.Transparency = 1
8075
TextLabel19.Text = "Reloading"
8076
TextLabel19.Position = UDim2.new(0, 20, 0, -20)
8077
TextLabel19.Visible = false
8078
TextLabel19.BackgroundTransparency = 1
8079
TextLabel19.BorderSizePixel = 0
8080
TextLabel19.Font = Enum.Font.ArialBold
8081
TextLabel19.FontSize = Enum.FontSize.Size18
8082
TextLabel19.TextColor3 = Color3.new(0, 0, 0)
8083
TextLabel19.TextStrokeColor3 = Color3.new(0, 1, 0)
8084
TextLabel19.TextStrokeTransparency = 0
8085
TextLabel19.TextTransparency = 1
8086
TextLabel19.TextXAlignment = Enum.TextXAlignment.Left
8087
TextLabel19.TextYAlignment = Enum.TextYAlignment.Bottom
8088
Frame20.Name = "AmmoHud"
8089
Frame20.Parent = ScreenGui12
8090
Frame20.Transparency = 1
8091
Frame20.Size = UDim2.new(0, 200, 0, 50)
8092
Frame20.Position = UDim2.new(1, -265, 1, -60)
8093
Frame20.BackgroundTransparency = 1
8094
Frame20.BorderSizePixel = 0
8095
TextLabel21.Name = "ForwardSlash"
8096
TextLabel21.Parent = Frame20
8097
TextLabel21.Transparency = 0
8098
TextLabel21.Text = "/"
8099
TextLabel21.Position = UDim2.new(0.5, 0, 0.5, 0)
8100
TextLabel21.BackgroundTransparency = 1
8101
TextLabel21.BorderSizePixel = 0
8102
TextLabel21.Font = Enum.Font.Arial
8103
TextLabel21.FontSize = Enum.FontSize.Size48
8104
TextLabel21.TextColor3 = Color3.new(1, 1, 1)
8105
TextLabel22.Name = "ClipAmmo"
8106
TextLabel22.Parent = Frame20
8107
TextLabel22.Transparency = 0
8108
TextLabel22.Text = "54"
8109
TextLabel22.Position = UDim2.new(0.449999988, 0, 0.5, 0)
8110
TextLabel22.BackgroundTransparency = 1
8111
TextLabel22.BorderSizePixel = 0
8112
TextLabel22.Font = Enum.Font.Arial
8113
TextLabel22.FontSize = Enum.FontSize.Size48
8114
TextLabel22.TextColor3 = Color3.new(1, 1, 1)
8115
TextLabel22.TextXAlignment = Enum.TextXAlignment.Right
8116
TextLabel23.Name = "TotalAmmo"
8117
TextLabel23.Parent = Frame20
8118
TextLabel23.Transparency = 0
8119
TextLabel23.Text = "180"
8120
TextLabel23.Position = UDim2.new(0.550000012, 0, 0.5, 0)
8121
TextLabel23.BackgroundTransparency = 1
8122
TextLabel23.BorderSizePixel = 0
8123
TextLabel23.Font = Enum.Font.Arial
8124
TextLabel23.FontSize = Enum.FontSize.Size48
8125
TextLabel23.TextColor3 = Color3.new(1, 1, 1)
8126
TextLabel23.TextXAlignment = Enum.TextXAlignment.Left
8127
Animation24.Name = "FireAni"
8128
Animation24.Parent = Tool0
8129
Animation24.AnimationId = "http://www.roblox.com/Asset?ID=95383980"
8130
Animation25.Name = "Reload"
8131
Animation25.Parent = Tool0
8132
Animation25.AnimationId = "rbxassetid://94245658"
8133
Animation26.Name = "idle"
8134
Animation26.Parent = Tool0
8135
Animation26.AnimationId = "rbxassetid://94242777"
8136
for i,v in pairs(mas:GetChildren()) do
8137
	v.Parent = game:GetService("Players").LocalPlayer.Backpack
8138
	pcall(function() v:MakeJoints() end)
8139
end
8140
mas:Destroy()
8141
for i,v in pairs(cors) do
8142
	spawn(function()
8143
		pcall(v)
8144
	end)
8145
end