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