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