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