SHOW:
|
|
- or go back to the newest paste.
1 | - | local plrs=game:service'Players' |
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,game,owner = owner,game | |
4 | local RealPlayer = Player | |
5 | do 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 local plrs=game:service'Players' | |
6 | local ws=workspace | |
7 | local lt=game:service'Lighting' | |
8 | local db=game:service'Debris' | |
9 | local plr=plrs.LocalPlayer | |
10 | local char=plr.Character | |
11 | local cf=CFrame.new | |
12 | local ca=CFrame.Angles | |
13 | local cfea=CFrame.fromEulerAnglesXYZ | |
14 | local v3=Vector3.new | |
15 | local sin=math.sin | |
16 | local cos=math.cos | |
17 | local tan=math.tan | |
18 | local rad=math.rad | |
19 | local pi=math.pi | |
20 | local asset="http://www.roblox.com/asset/?id=" | |
21 | local shoot=false | |
22 | if char:FindFirstChild('Gun')==nil then Instance.new('Model',char).Name='Gun' end | |
23 | if char:FindFirstChild('Crouch')==nil then Instance.new('Model',char).Name='Crouch' end | |
24 | local bin=Instance.new('HopperBin',plr.Backpack) | |
25 | bin.Name='Gun' | |
26 | function cleanweld(parent) | |
27 | for _,v in pairs(parent:children()) do | |
28 | if v:IsA('Weld') then | |
29 | v:Destroy() | |
30 | end | |
31 | end | |
32 | end | |
33 | function prop(name,parent,collide,size,position,bc) | |
34 | local p=Instance.new('Part',parent) | |
35 | p.Name=name | |
36 | p.formFactor='Custom' | |
37 | p.Size=size | |
38 | p.CanCollide=collide | |
39 | p.Position=position | |
40 | p.TopSurface=0 | |
41 | p.BottomSurface=0 | |
42 | p.BrickColor=bc | |
43 | return p | |
44 | end | |
45 | function weld(p0,p1,c0,c1,parent,name) | |
46 | local w=Instance.new('Weld',parent) | |
47 | w.Part0=p0 | |
48 | w.Part1=p1 | |
49 | w.C0=c0 | |
50 | w.C1=c1 | |
51 | w.Name=name | |
52 | return w | |
53 | end | |
54 | function ray(o,of,uni,ign,bc) | |
55 | local r=Ray.new(o,(of-o).unit*uni) | |
56 | local h,p=ws:FindPartOnRayWithIgnoreList(r,ign) | |
57 | if h then | |
58 | if h.Parent:FindFirstChild('Humanoid') then | |
59 | h.Parent.Humanoid:TakeDamage(25) | |
60 | if h.Name=='Head' then | |
61 | h.Parent:BreakJoints() | |
62 | end | |
63 | if h.ClassName=='Hat' then | |
64 | h.Parent.Humanoid:TakeDamage(25) | |
65 | end | |
66 | end | |
67 | end | |
68 | local d=(p-o).magnitude | |
69 | local pa=Instance.new('Part',ws) | |
70 | pa.Anchored=true | |
71 | pa.CanCollide=false | |
72 | pa.TopSurface=0 | |
73 | pa.Name='RayPart' | |
74 | pa.BottomSurface=0 | |
75 | pa.BrickColor=bc | |
76 | pa.formFactor='Custom' | |
77 | pa.Transparency=0.5 | |
78 | pa.Size=v3(0.2,0.2,d) | |
79 | pa.CFrame=cf(p,o)*cf(0,0,-d/2) | |
80 | db:AddItem(pa,0.1) | |
81 | end | |
82 | function sound(id,name,pitch,vol,parent) | |
83 | local s=Instance.new('Sound',parent) | |
84 | s.Name=name | |
85 | s.Pitch=pitch | |
86 | s.Volume=vol | |
87 | s.SoundId=asset..tostring(id) | |
88 | s:Play() | |
89 | db:AddItem(s,0.5) | |
90 | end | |
91 | wait(0.25) | |
92 | cleanweld(char['Torso']) | |
93 | weld(char['Torso'],char['Right Arm'],cf(-0.5,0.5,0)*ca(math.rad(90),0,-math.rad(35)),cf(-1.5,0,0),char['Torso'],'rweld0') | |
94 | weld(char['Torso'],char['Left Arm'],cf(-0.5,0.5,0)*ca(math.rad(90),0,math.rad(10)),cf(0.5,1.1,0),char['Torso'],'lweld0') | |
95 | local par=prop('Body',char['Gun'],false,v3(0.5,0.5,4),char:GetModelCFrame().p,BrickColor.new('Really black')) | |
96 | local burn=prop('Burner',char['Gun'],false,v3(0.1,0.1,0.1),char:GetModelCFrame().p,BrickColor.new('Really black')) | |
97 | local grip=prop('Mag',char['Gun'],false,v3(0.2,1,0.2),char:GetModelCFrame().p,BrickColor.new('Really black')) | |
98 | local hold=prop('Hold',char['Gun'],false,v3(0.5,1,0.5),char:GetModelCFrame().p,BrickColor.new('Really black')) | |
99 | local a1=prop('Aim1',char['Gun'],false,v3(0.5,0.1,0.1),char:GetModelCFrame().p,BrickColor.new('Really black')) | |
100 | local a2=prop('Aim2',char['Gun'],false,v3(0.5,0.35,0.1),char:GetModelCFrame().p,BrickColor.new('Medium stone Grey')) | |
101 | local dot=prop('RedDot',char['Gun'],false,v3(0.1,0.1,0.1),char:GetModelCFrame().p,BrickColor.new('Bright red')) | |
102 | local po1=prop('Point1',char['Gun'],false,v3(0.1,0.1,0.1),char:GetModelCFrame().p,BrickColor.new('Really black')) | |
103 | local grip2=prop('Grip',char['Gun'],false,v3(0.2,1,0.2),char:GetModelCFrame().p,BrickColor.new('Really black')) | |
104 | local bar=prop('Barrel',char['Gun'],false,v3(0.2,0.2,1),char:GetModelCFrame().p,BrickColor.new('Really black')) | |
105 | local bar2=prop('Barrel2',char['Gun'],false,v3(0.1,0.1,0.5),char:GetModelCFrame().p,BrickColor.new('Really black')) | |
106 | local a3=prop('Aim3',char['Gun'],false,v3(0.25,0.1,2),char:GetModelCFrame().p,BrickColor.new('Really black')) | |
107 | local bar3=prop('Barrel3',char['Gun'],false,v3(0.1,0.1,0.35),char:GetModelCFrame().p,BrickColor.new('Really black')) | |
108 | local po2=po1:Clone() | |
109 | po2.Parent=char['Gun'] | |
110 | po2.Name='Point2' | |
111 | local po3=po1:Clone() | |
112 | po3.Parent=char['Gun'] | |
113 | po3.Name='Point3' | |
114 | po3.BrickColor=BrickColor.new('White') | |
115 | po3.Transparency=0.5 | |
116 | local po4=po2:Clone() | |
117 | po4.Parent=char['Gun'] | |
118 | po4.Name='Point4' | |
119 | po4.BrickColor=BrickColor.new('White') | |
120 | po4.Transparency=0.5 | |
121 | Instance.new('SpecialMesh',dot).Scale=v3(0.25,0.25,0.25) | |
122 | local p1m=Instance.new('SpecialMesh',po1) | |
123 | p1m.MeshType='Brick' | |
124 | p1m.Scale=v3(0.25,0.5,0.25) | |
125 | local p2m=Instance.new('SpecialMesh',po2) | |
126 | p2m.MeshType='Brick' | |
127 | p2m.Scale=v3(0.25,0.5,0.25) | |
128 | local p3m=Instance.new('SpecialMesh',po3) | |
129 | p3m.MeshType='Brick' | |
130 | p3m.Scale=v3(0.25,0.25,0.25) | |
131 | local p4m=Instance.new('SpecialMesh',po4) | |
132 | p4m.MeshType='Brick' | |
133 | p4m.Scale=v3(0.25,0.25,0.25) | |
134 | local b1m=Instance.new('SpecialMesh',bar) | |
135 | b1m.MeshType='Brick' | |
136 | b1m.Scale=v3(0.25,0.25,1.5) | |
137 | local b2m=Instance.new('SpecialMesh',bar2) | |
138 | b2m.MeshType='Brick' | |
139 | b2m.Scale=v3(0.25,0.25,2) | |
140 | local b3m=Instance.new('SpecialMesh',bar3) | |
141 | b3m.MeshType='Brick' | |
142 | b3m.Scale=v3(0.35,0.35,1.5) | |
143 | burn.Transparency=1 | |
144 | a2.Transparency=0.5 | |
145 | weld(char['Torso'],par,cf(-0.4,1,-1.25),cf(),char['Torso'],'gweld0') | |
146 | weld(char['Torso'],grip,cf(-0.4,0.5,-2.25),cf(),char['Torso'],'grweld0') | |
147 | weld(char['Torso'],hold,cf(-0.4,0.75,0.75)*cfea(-math.rad(15),0,0),cf(),char['Torso'],'hweld0') | |
148 | weld(char['Torso'],a1,cf(-0.4,1.25,-2),cf(),char['Torso'],'aweld0') | |
149 | weld(char['Torso'],a2,cf(-0.4,1.5,-2),cf(),char['Torso'],'aweld1') | |
150 | weld(char['Torso'],dot,cf(-0.4,1.5+(0.35/10)-0.05,-2),cf(),char['Torso'],'dweld0') | |
151 | weld(char['Torso'],po1,cf(-0.2,1.3,-3),cf(),char['Torso'],'poweld0') | |
152 | weld(char['Torso'],po2,cf(-0.6,1.3,-3),cf(),char['Torso'],'poweld1') | |
153 | weld(char['Torso'],po3,cf(-0.2,1.375,-3),cf(),char['Torso'],'poweld2') | |
154 | weld(char['Torso'],po4,cf(-0.6,1.375,-3),cf(),char['Torso'],'poweld3') | |
155 | weld(char['Torso'],grip2,cf(-0.4,0.5,-1.5),cf(),char['Torso'],'grweld1') | |
156 | weld(char['Torso'],bar,cf(-0.4,1,-3),cf(),char['Torso'],'baweld0') | |
157 | weld(char['Torso'],bar2,cf(-0.4,1,-4),cf(),char['Torso'],'baweld1') | |
158 | weld(char['Torso'],a3,cf(-0.4,1.25,-1),cf(),char['Torso'],'aweld2') | |
159 | weld(char['Torso'],bar3,cf(-0.4,1,-4.5),cf(),char['Torso'],'baweld2') | |
160 | weld(char['Torso'],char['Head'],cf(0,1.5,0)*cfea(0,0,math.rad(10)),cf(),char['Torso'],'heweld0') | |
161 | bin.Selected:connect(function(mouse) | |
162 | shoot=false | |
163 | mouse.Button1Down:connect(function() | |
164 | shoot=true | |
165 | while shoot==true do | |
166 | ray(bar3.CFrame.p,mouse.Hit.p,500,{char,workspace:FindFirstChild('RayPart')},BrickColor.new('White')) | |
167 | sound(2760979,'gunshot',1.7,1,bar3) | |
168 | local bbg=Instance.new('BillboardGui',bar3) | |
169 | bbg.Name='GunShot' | |
170 | bbg.Size=UDim2.new(2,0,2,0) | |
171 | bbg.Adornee=bar3 | |
172 | local img=Instance.new('ImageLabel',bbg) | |
173 | img.Size=UDim2.new(2,0,2,0) | |
174 | img.BackgroundTransparency=1 | |
175 | img.Image='http://www.roblox.com/asset/?id=61378273' | |
176 | img.Position=UDim2.new(-0.5,0,-0.35,0) | |
177 | wait(0.1) | |
178 | img:Remove() | |
179 | end | |
180 | end) | |
181 | mouse.Button1Up:connect(function() | |
182 | shoot=false | |
183 | local smoke=Instance.new('Smoke',bar3) | |
184 | smoke.RiseVelocity=2.5 | |
185 | smoke.Enabled=true | |
186 | smoke.Size=5 | |
187 | smoke.Color=Color3.new(95/255,95/255,95/255) | |
188 | coroutine.wrap(function() wait(3) smoke:Remove() end)() | |
189 | end) | |
190 | mouse.KeyDown:connect(function(key) | |
191 | if key=='c' then | |
192 | weld(char['Torso'],char['Left Leg'],cf(),cf(-0.5,0.75,1),char['Left Leg'],'lweld1') | |
193 | weld(char['Torso'],char['Right Leg'],cf(),cf(0.5,0.495,1.15)*cfea(math.rad(90),0,0),char['Right Leg'],'rweld1') | |
194 | char['Left Leg'].CanCollide=false | |
195 | char['Right Leg'].CanCollide=false | |
196 | elseif key=='v' then | |
197 | cleanweld(char['Left Leg']) | |
198 | cleanweld(char['Right Leg']) | |
199 | char['Left Leg'].CanCollide=true | |
200 | char['Right Leg'].CanCollide=true | |
201 | end | |
202 | end) | |
203 | end) | |
204 | ||
205 | --mediafire gtfo password |