SHOW:
|
|
- or go back to the newest paste.
1 | --https://github.com/Mokiros/roblox-FE-compatibility | |
2 | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end | |
3 | local Player,Mouse,mouse,UserInputService,ContextActionService = owner | |
4 | local RealPlayer = Player | |
5 | do print("FE Compatibility code by Mokiros")local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c(),Button2Up=c(),Button2Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;if o.UserInputType==Enum.UserInputType.MouseButton2 then return f:TrigEvent(p and"Button2Down"or"Button2Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return typeof(t[q])=="function"and function(m,...)return t[q](t,...)end or t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return rawget(self,t)or r:GetService(t)end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService"),RunService=v({_btrs={},Soundscape=r:GetService("RunService").Heartbeat,BindToSoundscape=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;v(x,game)game,owner=x,x.Players.LocalPlayer end | |
6 | ||
7 | print("IM TRYING") | |
8 | wait(0.25); | |
9 | ||
10 | ||
11 | _clear=function() | |
12 | local c={char;bag;gui;}; | |
13 | for i=1,#c do | |
14 | local c=c[i]:children(); | |
15 | for i=1,#c do | |
16 | if(c[i].Name==name)then | |
17 | c[i].Parent=nil; | |
18 | end; | |
19 | end; | |
20 | end; | |
21 | local n=name..user.Name; | |
22 | local c=workspace:children(); | |
23 | for i=1,#c do | |
24 | if(c[i].Name==n)then | |
25 | c[i].Parent=nil; | |
26 | end; | |
27 | end; | |
28 | end; | |
29 | ||
30 | _valid_key=function(object,key) | |
31 | return object[key],key; | |
32 | end; | |
33 | ||
34 | _new=function(class) | |
35 | return function(props) | |
36 | if(type(list_base_props)=='table')then | |
37 | for i,v in next,list_base_props do | |
38 | if(props[i]==nil)then | |
39 | props[i]=v; | |
40 | end; | |
41 | end; | |
42 | end; | |
43 | ||
44 | local object=class; | |
45 | ||
46 | if(type(class)=='string')then | |
47 | object=Instance.new(class:sub(1,1):upper()..class:sub(2)); | |
48 | end; | |
49 | ||
50 | local parent=props[1]; | |
51 | props[1]=nil; | |
52 | ||
53 | for i,v in next,props do | |
54 | local load,res,key=pcall(_valid_key,object,i:sub(1,1):upper()..i:sub(2)); | |
55 | if(not load)then | |
56 | load,res,key=pcall(_valid_key,object,i); | |
57 | end; | |
58 | ||
59 | if(key)then | |
60 | t=type(res); | |
61 | s=tostring(res); | |
62 | if(t=='userdata'and s=='Signal '..key)then | |
63 | if(type(v)=='table')then | |
64 | for i=1,#v do | |
65 | res:connect(v[i]); | |
66 | end; | |
67 | else | |
68 | res:connect(v); | |
69 | end; | |
70 | else | |
71 | object[key]=v; | |
72 | end; | |
73 | end; | |
74 | end; | |
75 | ||
76 | if(parent)then | |
77 | object.Parent=parent; | |
78 | end; | |
79 | ||
80 | return object; | |
81 | end; | |
82 | end; | |
83 | ||
84 | _RGB=function(r,g,b) | |
85 | return Color3.new(r/255,g/255,b/255); | |
86 | end; | |
87 | ||
88 | _copy=function(o) | |
89 | local def=o.archivable; | |
90 | o.archivable=true; | |
91 | local c=o:clone(); | |
92 | o.archivable=def; | |
93 | return c; | |
94 | end; | |
95 | ||
96 | _hum=function(char) | |
97 | local hum=char:findFirstChild'Humanoid'; | |
98 | if(not hum or hum.className~='Humanoid')then | |
99 | local c=char:children(); | |
100 | for i=1,#c do | |
101 | if(c[i].className=='Humanoid')then | |
102 | return c[i]; | |
103 | end; | |
104 | end; | |
105 | else | |
106 | return hum; | |
107 | end; | |
108 | end; | |
109 | ||
110 | _hum_tag=function(hum) | |
111 | local c=hum:findFirstChild'creator'or Instance.new('ObjectValue',hum); | |
112 | c.Name='creator'; | |
113 | c.Value=user; | |
114 | if(hum.Health==0 and not hum:findFirstChild'killed')then | |
115 | Instance.new('BoolValue',hum).Name='killed'; | |
116 | bullets.clip=bullets.clip+10; | |
117 | end; | |
118 | end; | |
119 | ||
120 | _hum_dam=function(hum,dam,percent) | |
121 | hum.Health=hum.Health-(percent and hum.MaxHealth*(dam*0.01)or dam); | |
122 | if(hum.Health<=hum.MaxHealth*0.1)then | |
123 | _hum_tag(hum); | |
124 | end; | |
125 | end; | |
126 | ||
127 | _ray=function(v0,v1,i) | |
128 | local mag=(v0-v1).magnitude; | |
129 | local ray=Ray.new(v0,(v1-v0).unit*(mag>999 and 999 or mag)); | |
130 | ||
131 | return(type(i)=='table'and workspace.FindPartOnRayWithIgnoreList or workspace.FindPartOnRay)(workspace,ray,i); | |
132 | end; | |
133 | ||
134 | _must=function(v0,v1,i) | |
135 | local hit,pos=_ray(v0,v1,i); | |
136 | return not hit and mouse.target or hit,pos; | |
137 | end; | |
138 | ||
139 | _cframe=function(x,y,z,r0,r1,r2) | |
140 | return CFrame.Angles( | |
141 | math.rad(r0 or 0), | |
142 | math.rad(r1 or 0), | |
143 | math.rad(r2 or 0) | |
144 | )*CFrame.new(x,y,z); | |
145 | end; | |
146 | ||
147 | _update=function() | |
148 | if(bool_active and not screen.Parent)then | |
149 | screen.Parent=gui; | |
150 | elseif(not bool_active and screen.Parent)then | |
151 | screen.Parent=nil; | |
152 | end; | |
153 | end; | |
154 | ||
155 | _light=function(v0,v1) | |
156 | local mag=(v0-v1).magnitude; | |
157 | local len=math.random(2,7); | |
158 | len=len>mag/2 and mag/2 or len; | |
159 | ||
160 | --local light=_new'part'{ | |
161 | -- cFrame=CFrame.new(v0,v1); | |
162 | -- size=Vector3.new(1,1,1); | |
163 | -- color=_RGB(255,255,0); | |
164 | -- anchored=true; | |
165 | -- inv; | |
166 | --}; | |
167 | _new'blockMesh'{ | |
168 | scale=Vector3.new(0.2,0.2,len); | |
169 | offset=Vector3.new(0,0,-len/2); | |
170 | light; | |
171 | }; | |
172 | ||
173 | local bb=_new'billboardGui'{ | |
174 | size=UDim2.new(2,0,2,0); | |
175 | adornee=light; | |
176 | light; | |
177 | }; | |
178 | _new'imageLabel'{ | |
179 | image=url:format(109101526); | |
180 | backgroundTransparency=1; | |
181 | size=UDim2.new(1,0,1,0); | |
182 | bb; | |
183 | }; | |
184 | ||
185 | -- _rem(light,0.15); | |
186 | end; | |
187 | ||
188 | _rem=function(object,del) | |
189 | if(del)then | |
190 | delay(del,function() | |
191 | if(object.Parent)then | |
192 | object.Parent=nil; | |
193 | end; | |
194 | end); | |
195 | else | |
196 | pcall(function() | |
197 | if(object.Parent)then | |
198 | object.Parent=nil; | |
199 | end; | |
200 | end); | |
201 | end; | |
202 | end; | |
203 | ||
204 | _blood=function(pos,count) | |
205 | for i=1,count do | |
206 | local p=_new'part'{ | |
207 | rotVelocity=Vector3.new(math.random(),math.random(),math.random())*50; | |
208 | position=pos+Vector3.new(math.random(),math.random(),math.random()); | |
209 | velocity=Vector3.new(math.random(),math.random(),math.random())*50; | |
210 | size=Vector3.new(math.random(),math.random(),math.random())/3; | |
211 | color=_RGB(255,0,0); | |
212 | transparency=0.5; | |
213 | canCollide=true; | |
214 | bottomSurface=0; | |
215 | topSurface=0; | |
216 | formFactor=3; | |
217 | locked=true; | |
218 | inv; | |
219 | }; | |
220 | delay(5,function() | |
221 | p.Parent=nil; | |
222 | end); | |
223 | end; | |
224 | end; | |
225 | ||
226 | _make_hue=function() | |
227 | h_hue=_new'part'{ | |
228 | size=Vector3.new(0.25,1.8,0.35); | |
229 | color=_RGB(100,100,100); | |
230 | formFactor=3; | |
231 | name='hue'; | |
232 | handle; | |
233 | }; | |
234 | hh_weld=_new'weld'{ | |
235 | c1=_cframe(0,0.5,0); | |
236 | part0=handle; | |
237 | part1=h_hue; | |
238 | handle; | |
239 | }; | |
240 | end; | |
241 | ||
242 | _shot=function(v0,v1) | |
243 | if(not time_left)then | |
244 | time_left=0; | |
245 | end; | |
246 | if(time_left>time())then | |
247 | return nil; | |
248 | else | |
249 | time_left=time()+math.random(1,10)/100; | |
250 | end; | |
251 | ||
252 | if(bullets.current<1)then | |
253 | local tick_sound=head:findFirstChild'tick_sound'or _new'sound'{ | |
254 | soundId='rbxasset://sounds/SWITCH3.wav'; | |
255 | name='tick_sound'; | |
256 | volume=0.2; | |
257 | pitch=2; | |
258 | head; | |
259 | }; | |
260 | tick_sound:play(); | |
261 | if(bullets.clip>0)then | |
262 | time_left=time()+2; | |
263 | h_hue:breakJoints(); | |
264 | h_hue.CanCollide=true; | |
265 | h_hue.Velocity=(h_hue.CFrame*CFrame.new(0,5,0)).lookVector*10; | |
266 | _rem(h_hue,10); | |
267 | delay(1.9,function() | |
268 | _make_hue(); | |
269 | local got=(bullets.clip>bullets.maximum and | |
270 | bullets.maximum or | |
271 | bullets.clip)-bullets.current; | |
272 | ||
273 | bullets.clip=bullets.clip-got; | |
274 | bullets.current=bullets.current+got; | |
275 | end); | |
276 | end; | |
277 | return nil; | |
278 | else | |
279 | bullets.current=bullets.current-1; | |
280 | ||
281 | h_weld.C1=_cframe(0,0.75,0, | |
282 | -math.random(1000,1100)/10,180,0); | |
283 | d_weld.C1=_cframe(0,-0.25,0.3); | |
284 | ||
285 | lightstuff.Visible=true; | |
286 | delay(0.1,function() | |
287 | lightstuff.Visible=false; | |
288 | end); | |
289 | ||
290 | _rem(_new'part'{ | |
291 | velocity=CFrame.new(drag.Position,(drag.CFrame*CFrame.new(-4,-5,0)).p).lookVector*10; | |
292 | cFrame=drag.CFrame*CFrame.new(-0.5,0,0); | |
293 | size=Vector3.new(0.1,0.1,0.4); | |
294 | color=_RGB(200,200,0); | |
295 | material='Slate'; | |
296 | canCollide=true; | |
297 | formFactor=3; | |
298 | inv; | |
299 | },5); | |
300 | ||
301 | delay(0.1,function() | |
302 | d_weld.C1=_cframe(0,-0.25,0); | |
303 | if(bool_active)then | |
304 | h_weld.C1=h_weld_cf_active; | |
305 | end; | |
306 | end) | |
307 | end; | |
308 | ||
309 | local hit,pos=_must(v0,v1,char); | |
310 | ||
311 | shot_sound:play(); | |
312 | ||
313 | ||
314 | _rem(_new'part'{ | |
315 | cFrame=CFrame.new(v0,pos)*CFrame.new(0,0,-(v0-pos).magnitude*0.5); | |
316 | size=Vector3.new(0.1,0.1,(v0-pos).magnitude); | |
317 | color=_RGB(255,255,0); | |
318 | transparency=0.6; | |
319 | reflectance=0.5; | |
320 | canCollide=false; | |
321 | bottomSurface=0; | |
322 | anchored=true; | |
323 | formFactor=3; | |
324 | topSurface=0; | |
325 | inv; | |
326 | },.15); | |
327 | _light(v0,v1); | |
328 | ||
329 | if(not hit)then return nil;end; | |
330 | ||
331 | if(hit.Parent.className=='Hat')then | |
332 | hit:breakJoints(); | |
333 | hit.CanCollide=true; | |
334 | hit.Velocity=CFrame.new(v0,pos).lookVector*math.random(30,50); | |
335 | hit.RotVelocity=Vector3.new(math.random(1,90),math.random(1,90),math.random(1,90)); | |
336 | else | |
337 | local hum=_hum(hit.Parent); | |
338 | if(not hum)then | |
339 | if(hit.Anchored==false and hit.Size.magnitude<4)then | |
340 | hit:breakJoints(); | |
341 | hit.CanCollide=true; | |
342 | end; | |
343 | else | |
344 | _hum_dam(hum,math.random(4,6)); | |
345 | _blood(pos,math.random(3,6)); | |
346 | hit.RotVelocity=Vector3.new(math.random(1,90),math.random(1,90),math.random(1,90))/6; | |
347 | if(hit.Name=='Head')then | |
348 | hum.Health=0; | |
349 | _blood(pos,math.random(3,6)); | |
350 | delay(0.001,function() | |
351 | _new(workspace:FindFirstChild'head_shot'or'sound'){ | |
352 | pitch=math.random(70,100)*0.01; | |
353 | soundId=url:format(1876552); | |
354 | name='head_shot'; | |
355 | workspace; | |
356 | }:play(); | |
357 | end); | |
358 | _hum_tag(hum); | |
359 | _rem(_new'part'{ | |
360 | cFrame=CFrame.new(v0,pos)*CFrame.new(0,0,-(v0-pos).magnitude*0.5); | |
361 | size=Vector3.new(0.1,0.1,(v0-pos).magnitude); | |
362 | color=torso.Color; | |
363 | transparency=0.5; | |
364 | canCollide=false; | |
365 | bottomSurface=0; | |
366 | anchored=true; | |
367 | formFactor=3; | |
368 | topSurface=0; | |
369 | inv; | |
370 | },30); | |
371 | hit.Parent=nil; | |
372 | for b=0,1 do | |
373 | for a=0,1 do | |
374 | for i=0,1 do | |
375 | _rem(_new'part'{ | |
376 | velocity=CFrame.new(v0,pos).lookVector*20; | |
377 | cFrame=hit.CFrame*CFrame.new(i,-b,a); | |
378 | size=Vector3.new(0.5,0.5,0.5); | |
379 | color=_RGB(255,255,255); | |
380 | bottomSurface=0; | |
381 | canCollide=true; | |
382 | transparency=0; | |
383 | formFactor=3; | |
384 | topSurface=0; | |
385 | hum; | |
386 | },30); | |
387 | end; | |
388 | end; | |
389 | end; | |
390 | end; | |
391 | end; | |
392 | end; | |
393 | end; | |
394 | ||
395 | ||
396 | ||
397 | _cf_select=function(mouse) | |
398 | mouse.Icon=url:format(109111387);--108999296 | |
399 | bool_active=true; | |
400 | ||
401 | local arm=char:findFirstChild'Right Arm'; | |
402 | local weld=torso:findFirstChild'Right Shoulder'; | |
403 | if(arm and weld)then | |
404 | h_weld.Part0=arm; | |
405 | h_weld.C1=h_weld_cf_active; | |
406 | ||
407 | weld.Part1=nil; | |
408 | weld.Part0=nil; | |
409 | ||
410 | weld=_new(torso:findFirstChild'right_arml'or'weld'){ | |
411 | name='right_arml'; | |
412 | part0=torso; | |
413 | part1=arm; | |
414 | torso; | |
415 | }; | |
416 | ||
417 | arml=(arml or 0)+1; | |
418 | local alv=arml; | |
419 | local gyro=torso:findFirstChild'p_gyro'or Instance.new('BodyGyro',torso); | |
420 | gyro.maxTorque=Vector3.new(5e5,5e5,5e5); | |
421 | gyro.P=30000; | |
422 | gyro.D=1000; | |
423 | gyro.Name='p_gyro'; | |
424 | repeat | |
425 | local pos=mouse.hit.p; | |
426 | local val,valp,p0,p1,p2,hitpos,cj,c0,c1; | |
427 | ||
428 | val=-math.pi*0.5; | |
429 | valp=val*-1; | |
430 | p0=torso.CFrame; | |
431 | p0=p0+((p0*CFrame.Angles(valp,0,0)).lookVector*0.5)+(p0*CFrame.Angles(0,val,0)).lookVector; | |
432 | p1=p0+((p0.p-pos).unit*-2); | |
433 | p2=CFrame.new((p0.p+p1.p)/2,p0.p)*CFrame.Angles(val,val,0); | |
434 | hitpos=torso.Position; | |
435 | cj=CFrame.new(hitpos); | |
436 | c0=torso.CFrame:inverse()*cj; | |
437 | c1=p2:inverse()*cj; | |
438 | weld.C0=c0; | |
439 | weld.C1=c1; | |
440 | ||
441 | gyro.cframe=CFrame.new(torso.Position,Vector3.new(pos.X,torso.Position.Y,pos.Z)); | |
442 | ||
443 | wait(0.001); | |
444 | until arml~=alv; | |
445 | gyro.Parent=nil; | |
446 | end; | |
447 | end; | |
448 | ||
449 | _cf_deselect=function() | |
450 | bool_active=false; | |
451 | arml=(arml or 0)+1; | |
452 | loop_shot=(loop_shot or 0)+1; | |
453 | ||
454 | h_weld.Part0=torso; | |
455 | h_weld.C1=h_weld_cf_inactive; | |
456 | ||
457 | local weld=torso:findFirstChild'right_arml'; | |
458 | if(weld)then | |
459 | weld.Part1=nil; | |
460 | weld.Part0=nil; | |
461 | end; | |
462 | local arm=char:findFirstChild'Right Arm'; | |
463 | local weld=torso:findFirstChild'Right Shoulder'; | |
464 | if(arm and weld)then | |
465 | weld.Part0=torso; | |
466 | weld.Part1=arm; | |
467 | end; | |
468 | end; | |
469 | ||
470 | _cf_mouse=function(event,fun) | |
471 | mouse[event:sub(1,1):upper()..event:sub(2)]:connect(function(...) | |
472 | if(bool_active)then | |
473 | fun(...); | |
474 | end; | |
475 | end); | |
476 | end; | |
477 | ||
478 | ||
479 | do | |
480 | local main=getfenv(0); | |
481 | local c=game:children(); | |
482 | local check=function(v) | |
483 | if(v.className~=''and v.className~='Instance'and game:service(v.className))then | |
484 | main[v.className:sub(1,1):lower()..v.className:sub(2)]=v; | |
485 | end; | |
486 | end; | |
487 | for i=1,#c do | |
488 | pcall(check,c[i]); | |
489 | end; | |
490 | end; | |
491 | ||
492 | ||
493 | bullets={ | |
494 | maximum=51111111111111111111111111110; | |
495 | current=511111111111111111111111111111110; | |
496 | clip=501111111111111111111111111111111*4; | |
497 | }; | |
498 | ||
499 | list_base_props={ | |
500 | backgroundColor3=_RGB(0,0,0); | |
501 | textColor3=_RGB(200,200,200); | |
502 | borderSizePixel=0; | |
503 | color=_RGB(0,0,0); | |
504 | archivable=false; | |
505 | canCollide=false; | |
506 | bottomSurface=0; | |
507 | topSurface=0; | |
508 | formFactor=0; | |
509 | locked=true; | |
510 | }; | |
511 | ||
512 | ||
513 | ||
514 | user=players.localPlayer; | |
515 | mouse=user:getMouse(); | |
516 | char=user.Character; | |
517 | gui=user.PlayerGui; | |
518 | bag=user.Backpack; | |
519 | torso=char.Torso; | |
520 | head=char.Head; | |
521 | hum=_hum(char); | |
522 | ||
523 | url='rbxassetid://%d'; | |
524 | name='dev-uzi'; | |
525 | ||
526 | h_weld_cf_inactive=_cframe(0.35,0.5,0.5, | |
527 | 0,90,-70); | |
528 | h_weld_cf_active=_cframe(0,0.75,0, | |
529 | -110,180,0); | |
530 | ||
531 | assert(hum,'humanoid is not found'); | |
532 | ||
533 | ||
534 | ||
535 | _clear(); | |
536 | ||
537 | ||
538 | _cf_mouse('button1Down',function() | |
539 | loop_shot=(loop_shot or 0)+1; | |
540 | local vers=loop_shot; | |
541 | - | local step=runService.Stepped; |
541 | + | |
542 | _shot((tube.CFrame*CFrame.new(0,0,tube.Size.Z*0.5)).p,mouse.hit.p); | |
543 | wait(0.001); | |
544 | - | step:wait();--wait(0.001); |
544 | + | |
545 | end); | |
546 | ||
547 | _cf_mouse('button1Up',function() | |
548 | loop_shot=(loop_shot or 0)+1; | |
549 | end); | |
550 | ||
551 | _cf_mouse('move',function() | |
552 | cross_f.Position=UDim2.new(0,mouse.X-11,0,mouse.Y-11); | |
553 | end); | |
554 | ||
555 | _cf_mouse('keyDown',function(k) | |
556 | if(k=='r')then | |
557 | if(bullets.clip>0 and time_left<=time())then | |
558 | local got=(bullets.clip>bullets.maximum and | |
559 | bullets.maximum or | |
560 | bullets.clip)-bullets.current; | |
561 | ||
562 | bullets.clip=bullets.clip-got; | |
563 | bullets.current=bullets.current+got; | |
564 | if(got~=0)then | |
565 | time_left=time()+2; | |
566 | end; | |
567 | end; | |
568 | end; | |
569 | end); | |
570 | ||
571 | ||
572 | screen=_new'screenGui'{ | |
573 | name=name; | |
574 | }; | |
575 | ||
576 | cross_f=_new'frame'{ | |
577 | size=UDim2.new(0,21,0,21); | |
578 | backgroundTransparency=1; | |
579 | screen; | |
580 | }; | |
581 | ||
582 | for i=0,1 do | |
583 | _new'frame'{ | |
584 | position=UDim2.new(0,13*i,0,11); | |
585 | size=UDim2.new(0,10,0,1); | |
586 | cross_f; | |
587 | }; | |
588 | end; | |
589 | ||
590 | for i=0,1 do | |
591 | _new'frame'{ | |
592 | position=UDim2.new(0,11,0,13*i); | |
593 | size=UDim2.new(0,1,0,10); | |
594 | cross_f; | |
595 | }; | |
596 | end; | |
597 | ||
598 | ||
599 | ||
600 | shot_sound=_new(head:findFirstChild'2920959'or'sound'){ | |
601 | soundId=url:format(2920959); | |
602 | pitch=1.4; | |
603 | head; | |
604 | }; | |
605 | if(shot_sound.Name~='2920959')then | |
606 | shot_sound.Name='2920959'; | |
607 | shot_sound:play(); | |
608 | end; | |
609 | ||
610 | bin=_new'hopperBin'{ | |
611 | deselected=_cf_deselect; | |
612 | selected=_cf_select; | |
613 | name=name; | |
614 | bag; | |
615 | }; | |
616 | ||
617 | inv=_new'model'{ | |
618 | name=name; | |
619 | char; | |
620 | }; | |
621 | ||
622 | handle=_new'part'{ | |
623 | size=Vector3.new(0.3,1.3,0.4); | |
624 | color=_RGB(140,140,140); | |
625 | name='handle'; | |
626 | formFactor=3; | |
627 | inv; | |
628 | touched=function(hit) | |
629 | if(hit.Parent.className=='Model')then | |
630 | local hum=_hum(hit.Parent); | |
631 | if(hum~=nil)then | |
632 | _hum_dam(hum,handle.Velocity.magnitude); | |
633 | end; | |
634 | end; | |
635 | end; | |
636 | }; | |
637 | h_weld=_new'weld'{ | |
638 | c1=h_weld_cf_inactive; | |
639 | part1=handle; | |
640 | part0=torso; | |
641 | handle; | |
642 | }; | |
643 | _make_hue(); | |
644 | ||
645 | h_part=_new'part'{ | |
646 | size=Vector3.new(0.4,0.4,1.4); | |
647 | color=_RGB(140,140,140); | |
648 | name='handle'; | |
649 | formFactor=3; | |
650 | handle; | |
651 | }; | |
652 | hp_weld=_new'weld'{ | |
653 | c1=_cframe(0,-1.3/2,-0.3, | |
654 | 20,0,0); | |
655 | part0=handle; | |
656 | part1=h_part; | |
657 | handle; | |
658 | }; | |
659 | ||
660 | drag=_new'part'{ | |
661 | size=Vector3.new(0.5,0.45,1.5); | |
662 | color=_RGB(100,100,100); | |
663 | name='handle'; | |
664 | formFactor=3; | |
665 | handle; | |
666 | }; | |
667 | d_weld=_new'weld'{ | |
668 | c1=_cframe(0,-0.25,0); | |
669 | part0=h_part; | |
670 | part1=drag; | |
671 | handle; | |
672 | }; | |
673 | ||
674 | tube=_new'part'{ | |
675 | size=Vector3.new(0.2,0.2,1.5); | |
676 | color=_RGB(0,0,0); | |
677 | name='handle'; | |
678 | formFactor=3; | |
679 | handle; | |
680 | }; | |
681 | t_weld=_new'weld'{ | |
682 | c1=_cframe(0,-0.3,-0.1); | |
683 | part0=h_part; | |
684 | part1=tube; | |
685 | handle; | |
686 | }; | |
687 | ||
688 | bullets_label=_new'textLabel'{ | |
689 | textStrokeColor3=_RGB(0,0,0); | |
690 | textColor3=_RGB(200,200,200); | |
691 | textStrokeTransparency=0; | |
692 | backgroundTransparency=1; | |
693 | fontSize=5; | |
694 | screen; | |
695 | }; | |
696 | ||
697 | lightstuff=_new'frame'{ | |
698 | backgroundColor3=_RGB(255,255,255); | |
699 | position=UDim2.new(0,0,0,-1); | |
700 | backgroundTransparency=0.5; | |
701 | size=UDim2.new(1,0,1,1); | |
702 | borderSizePixel=0; | |
703 | visible=false; | |
704 | screen; | |
705 | }; | |
706 | ||
707 | coroutine.wrap(function() | |
708 | local red,white,green; | |
709 | repeat | |
710 | if(screen.Parent)then | |
711 | if(not green and bullets.current==bullets.maximum)then | |
712 | green=true; | |
713 | bullets_label.TextColor3=_RGB(0,200,0); | |
714 | elseif(not red and bullets.current==0)then | |
715 | red=true; | |
716 | bullets_label.TextColor3=_RGB(200,0,0); | |
717 | elseif((red or green)and bullets.current~=0 and bullets.current~=bullets.maximum)then | |
718 | bullets_label.TextColor3=_RGB(200,200,200); | |
719 | green=false; | |
720 | red=false; | |
721 | end; | |
722 | bullets_label.Text=('Bullets: %d/%d'):format(bullets.current,bullets.clip); | |
723 | bullets_label.Size=UDim2.new(0,bullets_label.TextBounds.X,0,bullets_label.TextBounds.Y); | |
724 | bullets_label.Position=UDim2.new(1,-bullets_label.TextBounds.X-6,1,-bullets_label.TextBounds.Y-6); | |
725 | end; | |
726 | wait(0.001); | |
727 | until nil; | |
728 | end)(); | |
729 | ||
730 | ||
731 | _G.dev_pistol_version=(_G.dev_pistol_version or 0)+1; | |
732 | local vers=_G.dev_pistol_version; | |
733 | repeat _update();wait(0.001);until _G.dev_pistol_version~=vers or hum.Health==0; | |
734 | if(hum.Health==0)then | |
735 | _clear(); | |
736 | end; |