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