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