SHOW:
|
|
- or go back to the newest paste.
1 | if game:GetService("RunService"):IsClient() then error("Please run as a server script. Use h/ instead of hl/.") end | |
2 | print("FE Compatibility code by Mokiros") | |
3 | InternalData = {} | |
4 | do | |
5 | script.Parent = owner.Character | |
6 | local Event = Instance.new("RemoteEvent") | |
7 | Event.Name = "UserInput" | |
8 | local function NewFakeEvent() | |
9 | local Fake = {fakeEvent=true,Connect=function(self,Func)self.Function=Func end}Fake.connect = Fake.Connect | |
10 | return Fake | |
11 | end | |
12 | local Mouse = {Target=nil,Hit=CFrame.new(),KeyUp=NewFakeEvent(),KeyDown=NewFakeEvent(),Button1Up=NewFakeEvent(),Button1Down=NewFakeEvent()} | |
13 | local UserInputService = {InputBegan=NewFakeEvent(),InputEnded=NewFakeEvent()} | |
14 | local ContextActionService = {Actions={},BindAction = function(self,actionName,Func,touch,...) | |
15 | self.Actions[actionName] = Func and {Name=actionName,Function=Func,Keys={...}} or nil | |
16 | end};ContextActionService.UnBindAction = ContextActionService.BindAction | |
17 | local function TriggerEvent(self,Event,...) | |
18 | local Trigger = Mouse[Event] | |
19 | if Trigger and Trigger.fakeEvent and Trigger.Function then | |
20 | Trigger.Function(...) | |
21 | end | |
22 | end | |
23 | Mouse.TrigEvent = TriggerEvent | |
24 | UserInputService.TrigEvent = TriggerEvent | |
25 | Event.OnServerEvent:Connect(function(FiredBy,Input) | |
26 | if FiredBy.Name ~= owner.Name then end | |
27 | if Input.MouseEvent then | |
28 | Mouse.Target = Input.Target | |
29 | Mouse.Hit = Input.Hit | |
30 | else | |
31 | local Begin = Input.UserInputState == Enum.UserInputState.Begin | |
32 | if Input.UserInputType == Enum.UserInputType.MouseButton1 then | |
33 | return Mouse:TrigEvent(Begin and "Button1Down" or "Button1Up") | |
34 | end | |
35 | for _,Action in pairs(ContextActionService.Actions) do | |
36 | for _,Key in pairs(Action.Keys) do | |
37 | if Key==Input.KeyCode then | |
38 | Action.Function(Action.Name,Input.UserInputState,Input) | |
39 | end | |
40 | end | |
41 | end | |
42 | Mouse:TrigEvent(Begin and "KeyDown" or "KeyUp",Input.KeyCode.Name:lower()) | |
43 | UserInputService:TrigEvent(Begin and "InputBegan" or "InputEnded",Input,false) | |
44 | end | |
45 | end) | |
46 | InternalData["Mouse"] = Mouse | |
47 | InternalData["ContextActionService"] = ContextActionService | |
48 | InternalData["UserInputService"] = UserInputService | |
49 | Event.Parent = NLS([[ | |
50 | local Player = owner | |
51 | local Event = script:WaitForChild("UserInput") | |
52 | local UserInputService = game:GetService("UserInputService") | |
53 | local Mouse = Player:GetMouse() | |
54 | local Input = function(Input,gameProcessedEvent) | |
55 | if gameProcessedEvent then return end | |
56 | Event:FireServer({KeyCode=Input.KeyCode,UserInputType=Input.UserInputType,UserInputState=Input.UserInputState}) | |
57 | end | |
58 | UserInputService.InputBegan:Connect(Input) | |
59 | UserInputService.InputEnded:Connect(Input) | |
60 | local Hit,Target | |
61 | while wait(1/30) do | |
62 | if Hit ~= Mouse.Hit or Target ~= Mouse.Target then | |
63 | Hit,Target = Mouse.Hit,Mouse.Target | |
64 | Event:FireServer({["MouseEvent"]=true,["Target"]=Target,["Hit"]=Hit}) | |
65 | end | |
66 | end | |
67 | ]],owner.Character) | |
68 | end | |
69 | RealGame = game;game = setmetatable({},{ | |
70 | __index = function (self,Index) | |
71 | local Sandbox = function (Thing) | |
72 | if Thing:IsA("Player") then | |
73 | local RealPlayer = Thing | |
74 | return setmetatable({},{ | |
75 | __index = function (self,Index) | |
76 | local Type = type(RealPlayer[Index]) | |
77 | if Type == "function" then | |
78 | if Index:lower() == "getmouse" or Index:lower() == "mouse" then | |
79 | return function (self) | |
80 | return InternalData["Mouse"] | |
81 | end | |
82 | end | |
83 | return function (self,...) | |
84 | return RealPlayer[Index](RealPlayer,...) | |
85 | end | |
86 | else | |
87 | if Index == "PlrObj" then | |
88 | return RealPlayer | |
89 | end | |
90 | return RealPlayer[Index] | |
91 | end | |
92 | end; | |
93 | __tostring = function(self) | |
94 | return RealPlayer.Name | |
95 | end | |
96 | }) | |
97 | end | |
98 | end | |
99 | if RealGame[Index] then | |
100 | local Type = type(RealGame[Index]) | |
101 | if Type == "function" then | |
102 | if Index:lower() == "getservice" or Index:lower() == "service" then | |
103 | return function (self,Service) | |
104 | if Service:lower() == "players" then | |
105 | return setmetatable({},{ | |
106 | __index = function (self2,Index2) | |
107 | local RealService = RealGame:GetService(Service) | |
108 | local Type2 = type(Index2) | |
109 | if Type2 == "function" then | |
110 | return function (self,...) | |
111 | return RealService[Index2](RealService,...) | |
112 | end | |
113 | else | |
114 | if Index2:lower() == "localplayer" then | |
115 | return Sandbox(owner) | |
116 | end | |
117 | return RealService[Index2] | |
118 | end | |
119 | end; | |
120 | __tostring = function(self) | |
121 | return RealGame:GetService(Service).Name | |
122 | end | |
123 | }) | |
124 | elseif Service:lower() == "contextactionservice" then | |
125 | return InternalData["ContextActionService"] | |
126 | elseif Service:lower() == "contextactionservice" then | |
127 | return InternalData["UserInputService"] | |
128 | elseif Service:lower() == "runservice" then | |
129 | return setmetatable({},{ | |
130 | __index = function(self2,Index2) | |
131 | local RealService = RealGame:GetService(Service) | |
132 | local Type2 = type(Index2) | |
133 | if Type2 == "function" then | |
134 | return function (self,...) | |
135 | return RealService[Index2](RealService,...) | |
136 | end | |
137 | else | |
138 | if Index2:lower() == "bindtorenderstep" then | |
139 | return function (self,Name,Priority,Function) | |
140 | return RealGame:GetService("RunService").Stepped:Connect(Function) | |
141 | end | |
142 | end | |
143 | if Index2:lower() == "renderstepped" then | |
144 | return RealService["Stepped"] | |
145 | end | |
146 | return RealService[Index2] | |
147 | end | |
148 | end | |
149 | }) | |
150 | else | |
151 | return RealGame:GetService(Service) | |
152 | end | |
153 | end | |
154 | end | |
155 | return function (self,...) | |
156 | return RealGame[Index](RealGame,...) | |
157 | end | |
158 | else | |
159 | if game:GetService(Index) then | |
160 | return game:GetService(Index) | |
161 | end | |
162 | return RealGame[Index] | |
163 | end | |
164 | else | |
165 | return nil | |
166 | end | |
167 | end | |
168 | });Game = game;owner = game:GetService("Players").LocalPlayer;script = {} | |
169 | print("Complete! Running...") | |
170 | ||
171 | ||
172 | --//Paste script below this line. | |
173 | ||
174 | function clerp(c1,c2,al) | |
175 | local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()} | |
176 | local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()} | |
177 | for i,v in pairs(com1) do | |
178 | com1[i] = v+(com2[i]-v)*al | |
179 | end | |
180 | return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1))) | |
181 | end | |
182 | ||
183 | plr = game:service'Players'.LocalPlayer | |
184 | plrgui = plr:findFirstChild'PlayerGui' | |
185 | plrmouse = plr:GetMouse() | |
186 | char = plr.Character | |
187 | humanoid = char:findFirstChild("Humanoid") | |
188 | torso = char:findFirstChild("Torso") | |
189 | head = char.Head | |
190 | ra = char:findFirstChild("Right Arm") | |
191 | la = char:findFirstChild("Left Arm") | |
192 | rl = char:findFirstChild("Right Leg") | |
193 | ll = char:findFirstChild("Left Leg") | |
194 | rs = torso:findFirstChild("Right Shoulder") | |
195 | ls = torso:findFirstChild("Left Shoulder") | |
196 | rh = torso:findFirstChild("Right Hip") | |
197 | lh = torso:findFirstChild("Left Hip") | |
198 | neck = torso:findFirstChild("Neck") | |
199 | rj = char:findFirstChild("HumanoidRootPart"):findFirstChild("RootJoint") | |
200 | rootpart = char:findFirstChild("HumanoidRootPart") | |
201 | camera = workspace.CurrentCamera | |
202 | anim = char:findFirstChild("Animate") | |
203 | ||
204 | local rm = Instance.new("Weld") | |
205 | rm.C0 = CFrame.new(1.5, 0.5, 0) | |
206 | rm.C1 = CFrame.new(0, 0.5, 0) | |
207 | rm.Part0 = torso | |
208 | rm.Part1 = ra | |
209 | rm.Name = 'Right Shoulder' | |
210 | ||
211 | local lm = Instance.new("Weld") | |
212 | lm.C0 = CFrame.new(-1.5, 0.5, 0) | |
213 | lm.C1 = CFrame.new(0, 0.5, 0) | |
214 | lm.Part0 = torso | |
215 | lm.Part1 = la | |
216 | lm.Name = 'Left Shoulder' | |
217 | ||
218 | local tool = Instance.new('HopperBin', plr.Backpack) | |
219 | tool.Name = 'Dual M1911' | |
220 | ||
221 | function scan(parent) | |
222 | local parts,last = {} | |
223 | for _,v in pairs(parent:GetChildren()) do | |
224 | if (v:IsA("BasePart")) then | |
225 | v.Anchored = true | |
226 | if (last) then | |
227 | local w = Instance.new("Weld") | |
228 | w.Name = ("%s_Weld"):format(v.Name) | |
229 | w.Part0,w.Part1 = last,v | |
230 | w.C0 = last.CFrame:inverse() | |
231 | w.C1 = v.CFrame:inverse() | |
232 | w.Parent = last | |
233 | end | |
234 | last = v | |
235 | table.insert(parts,v) | |
236 | end | |
237 | scan(v) | |
238 | end | |
239 | for _,v in pairs(parts) do | |
240 | v.Anchored = false | |
241 | v.Locked = true | |
242 | v.CanCollide = false | |
243 | end | |
244 | end | |
245 | ||
246 | --1-Torso | |
247 | holsters=Instance.new("Model") | |
248 | holsters.Name="Torso" | |
249 | holsters.Parent=char | |
250 | --2-HolsterWeldTo2 | |
251 | obj2=Instance.new("Part") | |
252 | obj2.CFrame=CFrame.new(Vector3.new(14.8519955,1.44200003,35.6479988)) * CFrame.Angles(1.8325955867767,-1.4901161193848e-008,-3.1415927410126) | |
253 | obj2.FormFactor=Enum.FormFactor.Custom | |
254 | obj2.LeftSurface=10 | |
255 | obj2.Transparency=1 | |
256 | obj2.TopSurface=10 | |
257 | obj2.RightSurface=10 | |
258 | obj2.Material="SmoothPlastic" | |
259 | obj2.Size=Vector3.new(0.200000003,0.200000003,1.60000014) | |
260 | obj2.FrontSurface=10 | |
261 | obj2.BottomSurface=10 | |
262 | obj2.BackSurface=10 | |
263 | obj2.BrickColor=BrickColor.new("Dark stone grey") | |
264 | obj2.Name="HolsterWeldTo2" | |
265 | obj2.Parent=holsters | |
266 | --3-Mesh | |
267 | obj3=Instance.new("BlockMesh") | |
268 | obj3.Scale=Vector3.new(0.999499977,1,1) | |
269 | obj3.Parent=obj2 | |
270 | --4-Belt | |
271 | obj4=Instance.new("Part") | |
272 | obj4.CFrame=CFrame.new(Vector3.new(13.6000061,1.49000156,35.8999977)) * CFrame.Angles(-1.4901162970204e-008,0,-0) | |
273 | obj4.FormFactor=Enum.FormFactor.Custom | |
274 | obj4.LeftSurface=10 | |
275 | obj4.TopSurface=10 | |
276 | obj4.RightSurface=10 | |
277 | obj4.Material="SmoothPlastic" | |
278 | obj4.Size=Vector3.new(2,0.200000003,1) | |
279 | obj4.FrontSurface=10 | |
280 | obj4.BottomSurface=10 | |
281 | obj4.BackSurface=10 | |
282 | obj4.BrickColor=BrickColor.new("Dark stone grey") | |
283 | obj4.Name="Belt" | |
284 | obj4.Parent=holsters | |
285 | --5-Mesh | |
286 | obj5=Instance.new("BlockMesh") | |
287 | obj5.Scale=Vector3.new(1.10000002,1,1.10000002) | |
288 | obj5.Parent=obj4 | |
289 | --6-Hold2 | |
290 | obj6=Instance.new("Part") | |
291 | obj6.CFrame=CFrame.new(Vector3.new(14.8000011,1.0950017,35.6999893)) * CFrame.Angles(0.26179936528206,0,-0) | |
292 | obj6.FormFactor=Enum.FormFactor.Custom | |
293 | obj6.LeftSurface=10 | |
294 | obj6.TopSurface=10 | |
295 | obj6.RightSurface=10 | |
296 | obj6.Material="SmoothPlastic" | |
297 | obj6.Size=Vector3.new(0.400000006,1.00999999,0.600000024) | |
298 | obj6.FrontSurface=10 | |
299 | obj6.BottomSurface=10 | |
300 | obj6.BackSurface=10 | |
301 | obj6.BrickColor=BrickColor.new("Dark stone grey") | |
302 | obj6.Name="Hold2" | |
303 | obj6.Parent=holsters | |
304 | --7-TorsoWeld | |
305 | obj7=Instance.new("Part") | |
306 | obj7.CFrame=CFrame.new(Vector3.new(13.6000061,1.99000168,35.8999939)) * CFrame.Angles(-0,0,-0) | |
307 | obj7.FormFactor=Enum.FormFactor.Custom | |
308 | obj7.LeftSurface=10 | |
309 | obj7.Transparency=1 | |
310 | obj7.TopSurface=10 | |
311 | obj7.RightSurface=10 | |
312 | obj7.Size=Vector3.new(2,2,1) | |
313 | obj7.FrontSurface=10 | |
314 | obj7.BottomSurface=10 | |
315 | obj7.BackSurface=10 | |
316 | obj7.BrickColor=BrickColor.new("Bright blue") | |
317 | obj7.Name="TorsoWeld" | |
318 | obj7.Parent=holsters | |
319 | --8-HolsterWeldTo | |
320 | obj8=Instance.new("Part") | |
321 | obj8.CFrame=CFrame.new(Vector3.new(12.342,1.44200003,35.6479988)) * CFrame.Angles(1.8325955867767,-1.4901161193848e-008,-3.1415927410126) | |
322 | obj8.FormFactor=Enum.FormFactor.Custom | |
323 | obj8.LeftSurface=10 | |
324 | obj8.Transparency=1 | |
325 | obj8.TopSurface=10 | |
326 | obj8.RightSurface=10 | |
327 | obj8.Material="SmoothPlastic" | |
328 | obj8.Size=Vector3.new(0.200000003,0.200000003,1.60000014) | |
329 | obj8.FrontSurface=10 | |
330 | obj8.BottomSurface=10 | |
331 | obj8.BackSurface=10 | |
332 | obj8.BrickColor=BrickColor.new("Dark stone grey") | |
333 | obj8.Name="HolsterWeldTo" | |
334 | obj8.Parent=holsters | |
335 | --9-Mesh | |
336 | obj9=Instance.new("BlockMesh") | |
337 | obj9.Scale=Vector3.new(0.999499977,1,1) | |
338 | obj9.Parent=obj8 | |
339 | --10-Hold | |
340 | obj10=Instance.new("Part") | |
341 | obj10.CFrame=CFrame.new(Vector3.new(12.4000053,1.09500158,35.6999893)) * CFrame.Angles(0.26179936528206,0,-0) | |
342 | obj10.FormFactor=Enum.FormFactor.Custom | |
343 | obj10.LeftSurface=10 | |
344 | obj10.TopSurface=10 | |
345 | obj10.RightSurface=10 | |
346 | obj10.Material="SmoothPlastic" | |
347 | obj10.Size=Vector3.new(0.400000006,1.00999999,0.600000024) | |
348 | obj10.FrontSurface=10 | |
349 | obj10.BottomSurface=10 | |
350 | obj10.BackSurface=10 | |
351 | obj10.BrickColor=BrickColor.new("Dark stone grey") | |
352 | obj10.Name="Hold" | |
353 | obj10.Parent=holsters | |
354 | holsters:MakeJoints() | |
355 | scan(holsters) | |
356 | ||
357 | --1-M1911 | |
358 | gun=Instance.new("Model") | |
359 | gun.Name="M1911" | |
360 | gun.Parent=char | |
361 | --2-Handle | |
362 | obj2=Instance.new("Part") | |
363 | obj2.CFrame=CFrame.new(Vector3.new(12.3420238,1.86332655,36.3927727)) * CFrame.Angles(1.5707963705063,-4.4703483581543e-008,3.1415927410126) | |
364 | obj2.FormFactor=Enum.FormFactor.Custom | |
365 | obj2.LeftSurface=10 | |
366 | obj2.TopSurface=10 | |
367 | obj2.RightSurface=10 | |
368 | obj2.Material=Enum.Material.Wood | |
369 | obj2.Size=Vector3.new(0.200000003,0.99999994,0.400000036) | |
370 | obj2.FrontSurface=10 | |
371 | obj2.BottomSurface=10 | |
372 | obj2.BackSurface=10 | |
373 | obj2.BrickColor=BrickColor.new("Brown") | |
374 | obj2.Name="Handle" | |
375 | obj2.Parent=gun | |
376 | --3-Decor | |
377 | obj3=Instance.new("Part") | |
378 | obj3.CFrame=CFrame.new(Vector3.new(12.3420143,2.28510284,35.9773712)) * CFrame.Angles(1.832595705986,0,-3.1415927410126) | |
379 | obj3.FormFactor=Enum.FormFactor.Custom | |
380 | obj3.LeftSurface=10 | |
381 | obj3.TopSurface=10 | |
382 | obj3.RightSurface=10 | |
383 | obj3.Material="SmoothPlastic" | |
384 | obj3.Size=Vector3.new(0.200000003,0.200000003,0.200000003) | |
385 | obj3.FrontSurface=10 | |
386 | obj3.BottomSurface=10 | |
387 | obj3.BackSurface=10 | |
388 | obj3.BrickColor=BrickColor.new("Dark stone grey") | |
389 | obj3.Name="Decor" | |
390 | obj3.Parent=gun | |
391 | --4-Mesh | |
392 | obj4=Instance.new("BlockMesh") | |
393 | obj4.Offset=Vector3.new(0,0.00999999978,0.0399999991) | |
394 | obj4.Scale=Vector3.new(0.699999988,0.200000003,0.800000012) | |
395 | obj4.Parent=obj3 | |
396 | --5-Decor | |
397 | obj5=Instance.new("Part") | |
398 | obj5.CFrame=CFrame.new(Vector3.new(12.3420143,1.46716928,35.8617401)) * CFrame.Angles(1.8325955867767,-1.4901161193848e-008,-3.1415927410126) | |
399 | obj5.FormFactor=Enum.FormFactor.Custom | |
400 | obj5.LeftSurface=10 | |
401 | obj5.TopSurface=10 | |
402 | obj5.RightSurface=10 | |
403 | obj5.Material="SmoothPlastic" | |
404 | obj5.Size=Vector3.new(0.200000003,0.400000006,0.200000003) | |
405 | obj5.FrontSurface=10 | |
406 | obj5.BottomSurface=10 | |
407 | obj5.BackSurface=10 | |
408 | obj5.BrickColor=BrickColor.new("Dark stone grey") | |
409 | obj5.Name="Decor" | |
410 | obj5.Parent=gun | |
411 | --6-Mesh | |
412 | obj6=Instance.new("BlockMesh") | |
413 | obj6.Scale=Vector3.new(0.600000024,1,0.200000003) | |
414 | obj6.Parent=obj5 | |
415 | --7-Decor | |
416 | obj7=Instance.new("Part") | |
417 | obj7.CFrame=CFrame.new(Vector3.new(12.3420124,1.55429673,36.0928192)) * CFrame.Angles(0.45686540007591,-1.1175870895386e-008,3.141592502594) | |
418 | obj7.FormFactor=Enum.FormFactor.Custom | |
419 | obj7.LeftSurface=10 | |
420 | obj7.TopSurface=10 | |
421 | obj7.RightSurface=10 | |
422 | obj7.Material="SmoothPlastic" | |
423 | obj7.Size=Vector3.new(0.200000003,0.310000002,0.200000003) | |
424 | obj7.FrontSurface=10 | |
425 | obj7.BottomSurface=10 | |
426 | obj7.BackSurface=10 | |
427 | obj7.BrickColor=BrickColor.new("Dark stone grey") | |
428 | obj7.Name="Decor" | |
429 | obj7.Parent=gun | |
430 | --8-Mesh | |
431 | obj8=Instance.new("BlockMesh") | |
432 | obj8.Scale=Vector3.new(0.600000024,1,0.200000003) | |
433 | obj8.Parent=obj7 | |
434 | --9-Decor | |
435 | obj9=Instance.new("Part") | |
436 | obj9.CFrame=CFrame.new(Vector3.new(12.3420258,2.21372294,35.8965569)) * CFrame.Angles(0.76370096206665,-1.4901161193848e-008,-3.1415927410126) | |
437 | obj9.FormFactor=Enum.FormFactor.Custom | |
438 | obj9.LeftSurface=10 | |
439 | obj9.TopSurface=10 | |
440 | obj9.RightSurface=10 | |
441 | obj9.Material="SmoothPlastic" | |
442 | obj9.Size=Vector3.new(0.200000003,0.200000003,0.200000003) | |
443 | obj9.FrontSurface=10 | |
444 | obj9.BottomSurface=10 | |
445 | obj9.BackSurface=10 | |
446 | obj9.BrickColor=BrickColor.new("Dark stone grey") | |
447 | obj9.Name="Decor" | |
448 | obj9.Parent=gun | |
449 | --10-Mesh | |
450 | obj10=Instance.new("BlockMesh") | |
451 | obj10.Scale=Vector3.new(0.400000006,0.200000003,1) | |
452 | obj10.Parent=obj9 | |
453 | --11-Decor | |
454 | obj11=Instance.new("Part") | |
455 | obj11.CFrame=CFrame.new(Vector3.new(12.3420229,1.8633275,36.2927704)) * CFrame.Angles(1.5707963705063,-4.4703483581543e-008,3.1415927410126) | |
456 | obj11.FormFactor=Enum.FormFactor.Custom | |
457 | obj11.LeftSurface=10 | |
458 | obj11.TopSurface=10 | |
459 | obj11.RightSurface=10 | |
460 | obj11.Material="SmoothPlastic" | |
461 | obj11.Size=Vector3.new(0.200000003,1.20000005,0.400000036) | |
462 | obj11.FrontSurface=10 | |
463 | obj11.BottomSurface=10 | |
464 | obj11.BackSurface=10 | |
465 | obj11.BrickColor=BrickColor.new("Dark stone grey") | |
466 | obj11.Name="Decor" | |
467 | obj11.Parent=gun | |
468 | --12-Mesh | |
469 | obj12=Instance.new("BlockMesh") | |
470 | obj12.Offset=Vector3.new(0,-0.0700000003,0) | |
471 | obj12.Scale=Vector3.new(0.995000005,0.949999988,1.20000005) | |
472 | obj12.Parent=obj11 | |
473 | --13-Decor | |
474 | obj13=Instance.new("Part") | |
475 | obj13.CFrame=CFrame.new(Vector3.new(12.3420258,2.30202365,35.8373909)) * CFrame.Angles(1.756756901741,-1.0430812835693e-007,3.1415927410126) | |
476 | obj13.FormFactor=Enum.FormFactor.Custom | |
477 | obj13.LeftSurface=10 | |
478 | obj13.TopSurface=10 | |
479 | obj13.RightSurface=10 | |
480 | obj13.Material="SmoothPlastic" | |
481 | obj13.Size=Vector3.new(0.200000003,0.200000003,0.200000003) | |
482 | obj13.FrontSurface=10 | |
483 | obj13.BottomSurface=10 | |
484 | obj13.BackSurface=10 | |
485 | obj13.BrickColor=BrickColor.new("Dark stone grey") | |
486 | obj13.Name="Decor" | |
487 | obj13.Parent=gun | |
488 | --14-Mesh | |
489 | obj14=Instance.new("BlockMesh") | |
490 | obj14.Scale=Vector3.new(0.400000006,0.200000003,0.400000006) | |
491 | obj14.Parent=obj13 | |
492 | --15-BulletCase | |
493 | obj15=Instance.new("Part") | |
494 | obj15.CFrame=CFrame.new(Vector3.new(12.3420229,1.44165683,35.6482697)) * CFrame.Angles(1.8325955867767,-1.4901161193848e-008,-3.1415927410126) | |
495 | obj15.FormFactor=Enum.FormFactor.Custom | |
496 | obj15.LeftSurface=10 | |
497 | obj15.TopSurface=10 | |
498 | obj15.RightSurface=10 | |
499 | obj15.Material="SmoothPlastic" | |
500 | obj15.Size=Vector3.new(0.200000003,0.200000003,1.60000014) | |
501 | obj15.FrontSurface=10 | |
502 | obj15.BottomSurface=10 | |
503 | obj15.BackSurface=10 | |
504 | obj15.BrickColor=BrickColor.new("Dark stone grey") | |
505 | obj15.Name="BulletCase" | |
506 | obj15.Parent=gun | |
507 | --16-Mesh | |
508 | obj16=Instance.new("BlockMesh") | |
509 | obj16.Scale=Vector3.new(0.999499977,1,1) | |
510 | obj16.Parent=obj15 | |
511 | --17-Flashlight | |
512 | obj17=Instance.new("Part") | |
513 | obj17.CFrame=CFrame.new(Vector3.new(12.3420115,0.729269207,35.601902)) * CFrame.Angles(-2.8797931671143,-1.7763568394003e-015,-3.1415927410126) | |
514 | obj17.FormFactor=Enum.FormFactor.Custom | |
515 | obj17.LeftSurface=10 | |
516 | obj17.TopSurface=10 | |
517 | obj17.RightSurface=10 | |
518 | obj17.Material="SmoothPlastic" | |
519 | obj17.Size=Vector3.new(0.200000003,0.200000003,0.200000003) | |
520 | obj17.FrontSurface=10 | |
521 | obj17.BottomSurface=10 | |
522 | obj17.BackSurface=10 | |
523 | obj17.BrickColor=BrickColor.new("Pastel yellow") | |
524 | obj17.Name="Flashlight" | |
525 | obj17.Parent=gun | |
526 | --18-Mesh | |
527 | obj18=Instance.new("CylinderMesh") | |
528 | obj18.Offset=Vector3.new(0,0,0.0500000007) | |
529 | obj18.Scale=Vector3.new(0.5,1.01999998,0.5) | |
530 | obj18.Parent=obj17 | |
531 | --19-Decor | |
532 | obj19=Instance.new("Part") | |
533 | obj19.CFrame=CFrame.new(Vector3.new(12.3420143,2.1178081,35.8290215)) * CFrame.Angles(1.832595705986,0,-3.1415927410126) | |
534 | obj19.FormFactor=Enum.FormFactor.Custom | |
535 | obj19.LeftSurface=10 | |
536 | obj19.TopSurface=10 | |
537 | obj19.RightSurface=10 | |
538 | obj19.Material="SmoothPlastic" | |
539 | obj19.Size=Vector3.new(0.200000003,0.400000036,0.200000003) | |
540 | obj19.FrontSurface=10 | |
541 | obj19.BottomSurface=10 | |
542 | obj19.BackSurface=10 | |
543 | obj19.BrickColor=BrickColor.new("Black") | |
544 | obj19.Name="Decor" | |
545 | obj19.Parent=gun | |
546 | --20-Mesh | |
547 | obj20=Instance.new("BlockMesh") | |
548 | obj20.Scale=Vector3.new(0.5,0.5,1.10000002) | |
549 | obj20.Parent=obj19 | |
550 | --21-Decor | |
551 | obj21=Instance.new("Part") | |
552 | obj21.CFrame=CFrame.new(Vector3.new(12.2895117,2.05304575,35.6843338)) * CFrame.Angles(1.832595705986,1.5699505805969,-3.1415927410126) | |
553 | obj21.FormFactor=Enum.FormFactor.Custom | |
554 | obj21.LeftSurface=10 | |
555 | obj21.TopSurface=10 | |
556 | obj21.RightSurface=10 | |
557 | obj21.Material="SmoothPlastic" | |
558 | obj21.Size=Vector3.new(0.399999976,0.200000003,0.200000003) | |
559 | obj21.FrontSurface=10 | |
560 | obj21.BottomSurface=10 | |
561 | obj21.BackSurface=10 | |
562 | obj21.BrickColor=BrickColor.new("Dark stone grey") | |
563 | obj21.Name="Decor" | |
564 | obj21.Parent=gun | |
565 | --22-Mesh | |
566 | obj22=Instance.new("SpecialMesh") | |
567 | obj22.MeshType=Enum.MeshType.Wedge | |
568 | obj22.Scale=Vector3.new(1,0.25,0.50999999) | |
569 | obj22.Parent=obj21 | |
570 | --23-Decor | |
571 | obj23=Instance.new("Part") | |
572 | obj23.CFrame=CFrame.new(Vector3.new(12.3420172,1.41577363,35.744442)) * CFrame.Angles(-2.8797931671143,-1.7763568394003e-015,-3.1415927410126) | |
573 | obj23.FormFactor=Enum.FormFactor.Custom | |
574 | obj23.LeftSurface=10 | |
575 | obj23.TopSurface=10 | |
576 | obj23.RightSurface=10 | |
577 | obj23.Material="SmoothPlastic" | |
578 | obj23.Size=Vector3.new(0.200000003,1.60000002,0.200000003) | |
579 | obj23.FrontSurface=10 | |
580 | obj23.BottomSurface=10 | |
581 | obj23.BackSurface=10 | |
582 | obj23.BrickColor=BrickColor.new("Dark stone grey") | |
583 | obj23.Name="Decor" | |
584 | obj23.Parent=gun | |
585 | --24-Mesh | |
586 | obj24=Instance.new("CylinderMesh") | |
587 | obj24.Parent=obj23 | |
588 | --25-ShellCaseSpawner | |
589 | obj25=Instance.new("Part") | |
590 | obj25.CFrame=CFrame.new(Vector3.new(12.3420172,1.75731552,35.6289024)) * CFrame.Angles(-2.8797931671143,-1.7763568394003e-015,-3.1415927410126) | |
591 | obj25.FormFactor=Enum.FormFactor.Custom | |
592 | obj25.LeftSurface=10 | |
593 | obj25.TopSurface=10 | |
594 | obj25.RightSurface=10 | |
595 | obj25.Material="SmoothPlastic" | |
596 | obj25.Size=Vector3.new(0.200000003,0.200000003,0.200000003) | |
597 | obj25.FrontSurface=10 | |
598 | obj25.BottomSurface=10 | |
599 | obj25.BackSurface=10 | |
600 | obj25.Name="ShellCaseSpawner" | |
601 | obj25.Parent=gun | |
602 | --26-Mesh | |
603 | obj26=Instance.new("CylinderMesh") | |
604 | obj26.Offset=Vector3.new(0.0149999997,0,-0.0350000001) | |
605 | obj26.Scale=Vector3.new(0.75,1,0.75) | |
606 | obj26.Parent=obj25 | |
607 | --27-Decor | |
608 | obj27=Instance.new("Part") | |
609 | obj27.CFrame=CFrame.new(Vector3.new(12.3420115,0.765501678,35.4666672)) * CFrame.Angles(-2.8797931671143,-1.7763568394003e-015,-3.1415927410126) | |
610 | obj27.FormFactor=Enum.FormFactor.Custom | |
611 | obj27.LeftSurface=10 | |
612 | obj27.TopSurface=10 | |
613 | obj27.RightSurface=10 | |
614 | obj27.Material="SmoothPlastic" | |
615 | obj27.Size=Vector3.new(0.200000003,0.200000003,0.200000003) | |
616 | obj27.FrontSurface=10 | |
617 | obj27.BottomSurface=10 | |
618 | obj27.BackSurface=10 | |
619 | obj27.BrickColor=BrickColor.new("Black") | |
620 | obj27.Name="Decor" | |
621 | obj27.Parent=gun | |
622 | --28-Mesh | |
623 | obj28=Instance.new("CylinderMesh") | |
624 | obj28.Offset=Vector3.new(0,0,0.0500000007) | |
625 | obj28.Scale=Vector3.new(0.5,1.01999998,0.5) | |
626 | obj28.Parent=obj27 | |
627 | --29-Decor | |
628 | obj29=Instance.new("Part") | |
629 | obj29.CFrame=CFrame.new(Vector3.new(12.3920164,1.4734931,35.5290413)) * CFrame.Angles(-1.3089969158173,-1.5701057910919,-0) | |
630 | obj29.FormFactor=Enum.FormFactor.Custom | |
631 | obj29.LeftSurface=10 | |
632 | obj29.TopSurface=10 | |
633 | obj29.RightSurface=10 | |
634 | obj29.Material="SmoothPlastic" | |
635 | obj29.Size=Vector3.new(1.60000002,0.200000003,0.200000003) | |
636 | obj29.FrontSurface=10 | |
637 | obj29.BottomSurface=10 | |
638 | obj29.BackSurface=10 | |
639 | obj29.BrickColor=BrickColor.new("Dark stone grey") | |
640 | obj29.Name="Decor" | |
641 | obj29.Parent=gun | |
642 | --30-Mesh | |
643 | obj30=Instance.new("SpecialMesh") | |
644 | obj30.MeshType=Enum.MeshType.Wedge | |
645 | obj30.Scale=Vector3.new(1,0.25,0.5) | |
646 | obj30.Parent=obj29 | |
647 | --31-Decor | |
648 | obj31=Instance.new("Part") | |
649 | obj31.CFrame=CFrame.new(Vector3.new(12.2895117,1.18371284,35.4513969)) * CFrame.Angles(1.832595705986,1.5699505805969,-3.1415927410126) | |
650 | obj31.FormFactor=Enum.FormFactor.Custom | |
651 | obj31.LeftSurface=10 | |
652 | obj31.TopSurface=10 | |
653 | obj31.RightSurface=10 | |
654 | obj31.Material="SmoothPlastic" | |
655 | obj31.Size=Vector3.new(1,0.200000003,0.200000003) | |
656 | obj31.FrontSurface=10 | |
657 | obj31.BottomSurface=10 | |
658 | obj31.BackSurface=10 | |
659 | obj31.BrickColor=BrickColor.new("Dark stone grey") | |
660 | obj31.Name="Decor" | |
661 | obj31.Parent=gun | |
662 | --32-Mesh | |
663 | obj32=Instance.new("SpecialMesh") | |
664 | obj32.MeshType=Enum.MeshType.Wedge | |
665 | obj32.Scale=Vector3.new(1,0.25,0.50999999) | |
666 | obj32.Parent=obj31 | |
667 | gun:MakeJoints() | |
668 | scan(gun) | |
669 | ||
670 | local gun2 = gun:clone() | |
671 | gun2.Parent = char | |
672 | ||
673 | local torsoweld = Instance.new('Weld', char) | |
674 | torsoweld.Part0 = torso | |
675 | torsoweld.Part1 = holsters.TorsoWeld | |
676 | torsoweld.C1 = CFrame.Angles(0,math.pi,0) | |
677 | ||
678 | local gunweld = Instance.new('Weld', char) | |
679 | gunweld.Part0 = gun.BulletCase | |
680 | gunweld.Part1 = holsters.HolsterWeldTo | |
681 | ||
682 | local gunweld2 = Instance.new('Weld', char) | |
683 | gunweld2.Part0 = gun2.BulletCase | |
684 | gunweld2.Part1 = holsters.HolsterWeldTo2 | |
685 | ||
686 | local bodygyro = Instance.new('BodyGyro') | |
687 | bodygyro.maxTorque = Vector3.new(14e16,14e16,14e16) | |
688 | bodygyro.P = 15000 | |
689 | ||
690 | local rsc0 = rm.C0 | |
691 | local lsc0 = lm.C0 | |
692 | local angle = 0 | |
693 | local anglespeed = .5 | |
694 | local speed = .3 | |
695 | local side = 0 | |
696 | local Equipped = false | |
697 | local origneckc0 = neck.C0 | |
698 | local origneckc1 = neck.C1 | |
699 | local neckc0 = CFrame.new(0, 1, 0) | |
700 | local firing = false | |
701 | local pistol = 1 | |
702 | local light = false | |
703 | ||
704 | local gunlight = Instance.new('SpotLight', gun.Flashlight) | |
705 | gunlight.Range = 40 | |
706 | gunlight.Angle = 60 | |
707 | gunlight.Face = 'Bottom' | |
708 | gunlight.Shadows = true | |
709 | gunlight.Enabled = false | |
710 | ||
711 | local gunlight2 = gunlight:clone() | |
712 | gunlight2.Parent = gun2.Flashlight | |
713 | ||
714 | local fire = Instance.new('Sound', head) | |
715 | fire.SoundId = "rbxassetid://132373536" | |
716 | fire.Volume = 1 | |
717 | ||
718 | local reload = Instance.new('Sound', head) | |
719 | reload.SoundId = "rbxassetid://138109513" | |
720 | reload.Volume = 1 | |
721 | ||
722 | local ammo = 14 | |
723 | local scrgui = Instance.new('ScreenGui', plrgui) | |
724 | scrgui.Name = 'DualGunsGui' | |
725 | ||
726 | local ammonution = Instance.new('TextLabel', scrgui) | |
727 | ammonution.Size = UDim2.new(0,150,0,50) | |
728 | ammonution.Position = UDim2.new(1, -250, 1, -70) | |
729 | ammonution.BackgroundTransparency = 1 | |
730 | ammonution.TextColor3 = Color3.new(1,1,1) | |
731 | ammonution.TextStrokeTransparency = .1 | |
732 | ammonution.Text = ('| '):rep(ammo) | |
733 | ammonution.TextXAlignment = 'Right' | |
734 | ammonution.ZIndex = 2 | |
735 | ammonution.FontSize = 'Size18' | |
736 | ||
737 | local ammonution2 = Instance.new('TextLabel', scrgui) | |
738 | ammonution2.Size = UDim2.new(0,150,0,50) | |
739 | ammonution2.Position = UDim2.new(1, -250, 1, -70) | |
740 | ammonution2.BackgroundTransparency = 1 | |
741 | ammonution2.TextColor3 = Color3.new(.5,.5,.5) | |
742 | ammonution2.TextStrokeTransparency = .1 | |
743 | ammonution2.TextXAlignment = 'Right' | |
744 | ammonution2.Text = ('| '):rep(ammo) | |
745 | ammonution2.FontSize = 'Size18' | |
746 | ||
747 | local rel = Instance.new('TextButton', scrgui) | |
748 | rel.Size = UDim2.new(0,500,0,250) | |
749 | rel.Position = UDim2.new(.5, -250, .8, -250) | |
750 | rel.BackgroundTransparency = 1 | |
751 | rel.TextColor3 = Color3.new(.7,0,0) | |
752 | rel.Visible = false | |
753 | rel.Text = 'Reload (r)' | |
754 | rel.FontSize = 'Size24' | |
755 | ||
756 | rel.MouseButton1Down:connect(function() | |
757 | if ammo >= 14 or firing then return end | |
758 | dontclerpneck = true | |
759 | firing = true | |
760 | local dropammo = gun.Handle:clone() | |
761 | dropammo:ClearAllChildren() | |
762 | dropammo.CanCollide = true | |
763 | dropammo.BrickColor = BrickColor.Black() | |
764 | dropammo.Parent = workspace | |
765 | dropammo.CFrame = gun.Handle.CFrame | |
766 | local dropammo2 = dropammo:clone() | |
767 | dropammo2.Parent = workspace | |
768 | dropammo2.CFrame = gun2.Handle.CFrame * CFrame.new(0, -.5, 0) | |
769 | game:service'Debris':AddItem(dropammo,15) | |
770 | game:service'Debris':AddItem(dropammo2,15) | |
771 | wait(.5) | |
772 | reload:play() | |
773 | for i = 1, 65 do | |
774 | firing = true | |
775 | rscf = rsc0 * CFrame.Angles(math.pi/2, 0, 0) | |
776 | lscf = lsc0 * CFrame.new(1.2, 0, -.4) * CFrame.Angles(math.pi/4 + math.sin(angle)*math.random()/20, math.rad(30), math.pi/3.2) | |
777 | lm.C0 = clerp(lm.C0,lscf,speed) | |
778 | rm.C0 = clerp(rm.C0,rscf,speed) | |
779 | game:service'RunService'.RenderStepped:wait() | |
780 | end | |
781 | reload:play() | |
782 | for i = 1, 65 do | |
783 | firing = true | |
784 | rscf = rsc0 * CFrame.new(-1.2, 0, -.4) * CFrame.Angles(math.pi/4 + math.sin(angle)*math.random()/20, -math.rad(30), -math.pi/3.2) | |
785 | lscf = lsc0 * CFrame.Angles(math.pi/2, 0, 0) | |
786 | lm.C0 = clerp(lm.C0,lscf,speed) | |
787 | rm.C0 = clerp(rm.C0,rscf,speed) | |
788 | game:service'RunService'.RenderStepped:wait() | |
789 | end | |
790 | dontclerpneck = false | |
791 | firing = false | |
792 | ammo = 14 | |
793 | ammonution.Text = ('| '):rep(ammo) | |
794 | end) | |
795 | tool.Selected:connect(function(mouse) | |
796 | Equipped = true | |
797 | bodygyro.Parent = torso | |
798 | bodygyro.cframe = torso.CFrame | |
799 | rs.Parent = nil | |
800 | ls.Parent = nil | |
801 | rm.Parent = torso | |
802 | lm.Parent = torso | |
803 | neck.C0 = CFrame.new(0, 1, 0) | |
804 | neck.C1 = CFrame.new(0, -0.5, 0) | |
805 | gunweld.Part0 = gun.Handle | |
806 | gunweld2.Part0 = gun2.Handle | |
807 | gunweld.Part1 = ra | |
808 | gunweld2.Part1 = la | |
809 | gunweld.C1 = CFrame.new(0, -.8, 0) | |
810 | gunweld.C0 = CFrame.Angles(math.pi/2-math.rad(15), 0, math.pi) | |
811 | gunweld2.C1 = CFrame.new(0, -.8, 0) | |
812 | gunweld2.C0 = CFrame.Angles(math.pi/2-math.rad(15), 0, math.pi) | |
813 | mouse.KeyDown:connect(function(k) | |
814 | if k == "r" then | |
815 | if ammo >= 14 or firing then return end | |
816 | dontclerpneck = true | |
817 | firing = true | |
818 | local dropammo = gun.Handle:clone() | |
819 | dropammo:ClearAllChildren() | |
820 | dropammo.CanCollide = true | |
821 | dropammo.BrickColor = BrickColor.Black() | |
822 | dropammo.Parent = workspace | |
823 | dropammo.CFrame = gun.Handle.CFrame | |
824 | local dropammo2 = dropammo:clone() | |
825 | dropammo2.Parent = workspace | |
826 | dropammo2.CFrame = gun2.Handle.CFrame * CFrame.new(0, -.5, 0) | |
827 | game:service'Debris':AddItem(dropammo,15) | |
828 | game:service'Debris':AddItem(dropammo2,15) | |
829 | wait(.5) | |
830 | reload:play() | |
831 | for i = 1, 65 do | |
832 | firing = true | |
833 | rscf = rsc0 * CFrame.Angles(math.pi/2, 0, 0) | |
834 | lscf = lsc0 * CFrame.new(1.2, 0, -.4) * CFrame.Angles(math.pi/4 + math.sin(angle)*math.random()/20, math.rad(30), math.pi/3.2) | |
835 | lm.C0 = clerp(lm.C0,lscf,speed) | |
836 | rm.C0 = clerp(rm.C0,rscf,speed) | |
837 | game:service'RunService'.RenderStepped:wait() | |
838 | end | |
839 | reload:play() | |
840 | for i = 1, 65 do | |
841 | firing = true | |
842 | rscf = rsc0 * CFrame.new(-1.2, 0, -.4) * CFrame.Angles(math.pi/4 + math.sin(angle)*math.random()/20, -math.rad(30), -math.pi/3.2) | |
843 | lscf = lsc0 * CFrame.Angles(math.pi/2, 0, 0) | |
844 | lm.C0 = clerp(lm.C0,lscf,speed) | |
845 | rm.C0 = clerp(rm.C0,rscf,speed) | |
846 | game:service'RunService'.RenderStepped:wait() | |
847 | end | |
848 | dontclerpneck = false | |
849 | firing = false | |
850 | ammo = 14 | |
851 | ammonution.Text = ('| '):rep(ammo) | |
852 | end | |
853 | if k == "f" then | |
854 | light = not light | |
855 | local sound = Instance.new('Sound', head) | |
856 | sound.SoundId = "rbxassetid://115959318" | |
857 | sound.Volume = 1 | |
858 | sound:play() | |
859 | game:service'Debris':AddItem(sound,1) | |
860 | end | |
861 | end) | |
862 | mouse.Button1Down:connect(function() | |
863 | if ammo <= 0 then | |
864 | local sound = Instance.new('Sound', head) | |
865 | sound.SoundId = "rbxassetid://132464034" | |
866 | sound.Volume = 1 | |
867 | sound:play() | |
868 | game:service'Debris':AddItem(sound,1) | |
869 | end | |
870 | if firing or ammo <= 0 then return end | |
871 | ammo = ammo - 1 | |
872 | ammonution.Text = ('| '):rep(ammo) | |
873 | firing = true | |
874 | local pa = Instance.new('Part') | |
875 | pa.CanCollide = false | |
876 | pa.Anchored = true | |
877 | pa.Locked = true | |
878 | pa.FormFactor = 'Custom' | |
879 | pa.BrickColor = BrickColor.new('New Yeller') | |
880 | pa.Size = Vector3.new(.2,3,.2) | |
881 | Instance.new('BlockMesh', pa).Scale = Vector3.new(.2,3,.2) | |
882 | local thegun | |
883 | if pistol == 1 then | |
884 | thegun = gun.BulletCase | |
885 | elseif pistol == 2 then | |
886 | thegun = gun2.BulletCase | |
887 | end | |
888 | local muzzle = Instance.new('PointLight', thegun) | |
889 | muzzle.Range = 12 | |
890 | muzzle.Color = Color3.new(1,.6,.1) | |
891 | game:service'Debris':AddItem(muzzle, .05) | |
892 | local shell = pa:clone() | |
893 | shell:ClearAllChildren() | |
894 | shell.Anchored = false | |
895 | shell.CFrame = thegun.Parent.ShellCaseSpawner.CFrame | |
896 | shell.Size = Vector3.new(.2,.5,.2) | |
897 | shell.Parent = workspace | |
898 | shell.BrickColor = BrickColor.new('Bright yellow') | |
899 | shell.CanCollide = true | |
900 | game:service'Debris':AddItem(shell, 5) | |
901 | local bulletpos = thegun.Position | |
902 | local bulletvelocity = (mouse.Hit.p - bulletpos).unit*15 | |
903 | local lastbulletpos = thegun.Position | |
904 | fire:play() | |
905 | coroutine.wrap(function() | |
906 | while game:service'RunService'.Stepped:wait() do | |
907 | lastbulletpos = bulletpos | |
908 | bulletpos = bulletpos + bulletvelocity | |
909 | local RayCast = Ray.new(lastbulletpos, (bulletpos - lastbulletpos)) | |
910 | local hit, hitpos = workspace:FindPartOnRay(RayCast, char) | |
911 | if (torso.Position - pa.Position).magnitude > 800 then | |
912 | pa:Destroy() | |
913 | break | |
914 | end | |
915 | pa.Anchored = true | |
916 | pa.CFrame = CFrame.new(bulletpos, bulletpos+bulletvelocity) * CFrame.Angles(math.pi/2, 0, 0) | |
917 | if hit then | |
918 | local damage | |
919 | local sound = Instance.new('Sound', pa) | |
920 | sound.SoundId = "rbxassetid://166423137" | |
921 | sound.Pitch = 1.2+math.random()/3 | |
922 | sound.Volume = 1 | |
923 | sound:play() | |
924 | pa:Destroy() | |
925 | game:service'Debris':AddItem(sound,4) | |
926 | local ray = Ray.new(rootpart.Position, Vector3.new(0, -6, 0)) | |
927 | local hitz, enz = workspace:FindPartOnRay(ray, char) | |
928 | local hum = hit and hit.Parent and hit.Parent:findFirstChild'Humanoid' | |
929 | if hum then | |
930 | damage = math.random(5,10) | |
931 | hum:TakeDamage(damage) | |
932 | end | |
933 | local hum = hit and hit.Parent and hit.Parent.Parent and hit.Parent.Parent:findFirstChild'Humanoid' | |
934 | if hum then | |
935 | damage = math.random(5,10) | |
936 | hum:TakeDamage(damage) | |
937 | end | |
938 | break | |
939 | end | |
940 | pa.Anchored = true | |
941 | pa.Parent = char | |
942 | pa.CFrame = CFrame.new(bulletpos, bulletpos+bulletvelocity) * CFrame.Angles(math.pi/2, 0, 0) | |
943 | end | |
944 | end)() | |
945 | ||
946 | if pistol == 1 then | |
947 | pistol = 2 | |
948 | for i = 1, 4 do | |
949 | rscf = CFrame.new(Vector3.new(rsc0.x, rsc0.y, rsc0.z), torso.CFrame:pointToObjectSpace(plrmouse.Hit.p)) * CFrame.new(0, 0, .5) * CFrame.Angles(math.pi/1.5 + math.sin(angle)*math.random()/20, 0, math.cos(angle)*math.random()/20) | |
950 | lscf = CFrame.new(Vector3.new(lsc0.x, lsc0.y, lsc0.z), torso.CFrame:pointToObjectSpace(plrmouse.Hit.p)) * CFrame.Angles(math.pi/2 + math.sin(angle)*math.random()/20, 0, -math.cos(angle)*math.random()/20) | |
951 | lm.C0 = clerp(lm.C0,lscf,speed) | |
952 | rm.C0 = clerp(rm.C0,rscf,speed) | |
953 | game:service'RunService'.RenderStepped:wait() | |
954 | end | |
955 | elseif pistol == 2 then | |
956 | for i = 1, 4 do | |
957 | rscf = CFrame.new(Vector3.new(rsc0.x, rsc0.y, rsc0.z), torso.CFrame:pointToObjectSpace(plrmouse.Hit.p)) * CFrame.Angles(math.pi/2 + math.sin(angle)*math.random()/20, 0, math.cos(angle)*math.random()/20) | |
958 | lscf = CFrame.new(Vector3.new(lsc0.x, lsc0.y, lsc0.z), torso.CFrame:pointToObjectSpace(plrmouse.Hit.p)) * CFrame.new(0, 0, .5) * CFrame.Angles(math.pi/1.5 + math.sin(angle)*math.random()/20, 0, -math.cos(angle)*math.random()/20) | |
959 | lm.C0 = clerp(lm.C0,lscf,speed) | |
960 | rm.C0 = clerp(rm.C0,rscf,speed) | |
961 | game:service'RunService'.RenderStepped:wait() | |
962 | end | |
963 | pistol = 1 | |
964 | end | |
965 | firing = false | |
966 | end) | |
967 | end) | |
968 | tool.Deselected:connect(function() | |
969 | Equipped = false | |
970 | rm.Parent = nil | |
971 | lm.Parent = nil | |
972 | rs.Parent = torso | |
973 | ls.Parent = torso | |
974 | neck.C0 = origneckc0 | |
975 | neck.C1 = origneckc1 | |
976 | lm.C0 = lsc0 | |
977 | rm.C0 = rsc0 | |
978 | gunweld.Part0 = gun.BulletCase | |
979 | gunweld.Part1 = holsters.HolsterWeldTo | |
980 | gunweld.C0 = CFrame.new() | |
981 | gunweld.C1 = CFrame.new() | |
982 | gunweld2.Part0 = gun2.BulletCase | |
983 | gunweld2.Part1 = holsters.HolsterWeldTo2 | |
984 | gunweld2.C0 = CFrame.new() | |
985 | gunweld2.C1 = CFrame.new() | |
986 | bodygyro.Parent = nil | |
987 | end) | |
988 | ||
989 | game:service'RunService'.RenderStepped:connect(function() | |
990 | if Equipped then | |
991 | if ammo <= 0 then | |
992 | rel.Visible = true | |
993 | else | |
994 | rel.Visible = false | |
995 | end | |
996 | if light then | |
997 | gunlight.Enabled = true | |
998 | gunlight2.Enabled = true | |
999 | else | |
1000 | gunlight.Enabled = false | |
1001 | gunlight2.Enabled = false | |
1002 | end | |
1003 | angle = angle + (0.05+math.random()/20) | |
1004 | local rscf = rsc0 | |
1005 | local lscf = lsc0 | |
1006 | local ncf = neckc0 | |
1007 | local rmx,rmy,rmz = rm.C0:toEulerAnglesXYZ() | |
1008 | if rmz >= 1 then | |
1009 | bodygyro.cframe = bodygyro.cframe * CFrame.Angles(0, -rmz/5, 0) | |
1010 | elseif rmz <= -1 then | |
1011 | bodygyro.cframe = bodygyro.cframe * CFrame.Angles(0, -rmz/5, 0) | |
1012 | end | |
1013 | rscf = CFrame.new(Vector3.new(rsc0.x, rsc0.y, rsc0.z), torso.CFrame:pointToObjectSpace(plrmouse.Hit.p)) * CFrame.Angles(math.pi/2 + math.sin(angle)*math.random()/20, 0, math.cos(angle)*math.random()/20) | |
1014 | lscf = CFrame.new(Vector3.new(lsc0.x, lsc0.y, lsc0.z), torso.CFrame:pointToObjectSpace(plrmouse.Hit.p)) * CFrame.Angles(math.pi/2 + math.sin(angle)*math.random()/20, 0, -math.cos(angle)*math.random()/20) | |
1015 | ncf = neckc0 * CFrame.new(Vector3.new(), torso.CFrame:pointToObjectSpace(plrmouse.Hit.p)) | |
1016 | if not firing then | |
1017 | lm.C0 = clerp(lm.C0,lscf,speed) | |
1018 | rm.C0 = clerp(rm.C0,rscf,speed) | |
1019 | end | |
1020 | if not dontclerpneck then | |
1021 | neck.C0 = clerp(neck.C0,ncf,speed) | |
1022 | end | |
1023 | end | |
1024 | if light and not Equipped then | |
1025 | gunlight.Enabled = false | |
1026 | gunlight2.Enabled = false | |
1027 | end | |
1028 | end) |