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;print("FE Compatibility by WaverlyCole");InternalData = {}InternalData.RealOwner = owner;InternalData.RealObjs = {};InternalData.SoundLoudness = {}; |
1 | + | |
2 | - | do |
2 | + | |
3 | - | script.Parent = InternalData.RealOwner.Character |
3 | + | |
4 | - | local Event = Instance.new("RemoteEvent");Event.Name = "UserInput";InternalData.Event = Event |
4 | + | |
5 | - | local function createObject (connections, index) |
5 | + | |
6 | - | local proxy = newproxy (true);local meta = getmetatable (proxy); |
6 | + | |
7 | - | local runbind = function (self, i, ...) connections[i]:Fire (...); end; |
7 | + | |
8 | - | while (#connections > 0) do connections[table.remove(connections, 1)] = Instance.new ('BindableEvent');end; |
8 | + | |
9 | - | meta.__index = function (self, i) |
9 | + | |
10 | - | if (i == 'TriggerEvent') then return runbind end; |
10 | + | |
11 | - | return connections[i] and connections[i].Event or index[i]; |
11 | + | |
12 | - | end; |
12 | + | |
13 | - | meta.__newindex = index;meta.__metatable = false;return proxy |
13 | + | |
14 | - | end; |
14 | + | |
15 | - | local Mouse = createObject({"KeyUp","KeyDown","Button1Down","Button1Up","Move","Button2Down","Button2Up"},{["Target"] = nil;["Hit"] = CFrame.new()}) |
15 | + | |
16 | - | local UserInputService = createObject({"InputBegan","InputEnded"},{}) |
16 | + | |
17 | - | local ContextActionService = {Actions={},BindAction = function(self,actionName,Func,touch,...) |
17 | + | |
18 | - | self.Actions[actionName] = Func and {Name=actionName,Function=Func,Keys={...}} or nil |
18 | + | |
19 | - | end};ContextActionService.UnBindAction = ContextActionService.BindAction |
19 | + | |
20 | - | Event.OnServerEvent:Connect(function(FiredBy,Input) |
20 | + | |
21 | - | if FiredBy ~= InternalData.RealOwner then return end |
21 | + | |
22 | - | if Input.MouseEvent then |
22 | + | |
23 | - | Mouse.Target = Input.Target;Mouse.Hit = Input.Hit |
23 | + | |
24 | - | Mouse:TriggerEvent("Move") |
24 | + | |
25 | - | elseif Input.Sound then |
25 | + | |
26 | - | if InternalData.SoundLoudness[Input.Sound] then InternalData.SoundLoudness[Input.Sound] = Input.Loudness end |
26 | + | |
27 | - | else |
27 | + | |
28 | - | local Begin = Input.UserInputState == Enum.UserInputState.Begin |
28 | + | |
29 | - | if Input.UserInputType == Enum.UserInputType.MouseButton1 then return Mouse:TriggerEvent(Begin and "Button1Down" or "Button1Up") end |
29 | + | |
30 | - | if Input.UserInputType == Enum.UserInputType.MouseButton2 then return Mouse:TriggerEvent(Begin and "Button2Down" or "Button2Up") end |
30 | + | |
31 | - | for _,Action in pairs(ContextActionService.Actions) do |
31 | + | |
32 | - | for _,Key in pairs(Action.Keys) do if Key==Input.KeyCode then Action.Function(Action.Name,Input.UserInputState,Input) end end |
32 | + | |
33 | - | end |
33 | + | |
34 | - | Mouse:TriggerEvent(Begin and "KeyDown" or "KeyUp",Input.KeyCode.Name:lower());UserInputService:TriggerEvent(Begin and "InputBegan" or "InputEnded",Input,false) |
34 | + | |
35 | - | end |
35 | + | |
36 | - | end) |
36 | + | |
37 | - | InternalData["Mouse"] = Mouse;InternalData["ContextActionService"] = ContextActionService;InternalData["UserInputService"] = UserInputService |
37 | + | |
38 | - | Event.Parent = NLS([[ |
38 | + | |
39 | - | local Player = owner; |
39 | + | |
40 | - | local Sounds = {}; |
40 | + | |
41 | - | local Event = script:WaitForChild("UserInput"); |
41 | + | |
42 | - | local UserInputService = game:GetService("UserInputService"); |
42 | + | |
43 | - | local Mouse = Player:GetMouse(); |
43 | + | |
44 | - | local Input = function(Input,gameProcessedEvent) |
44 | + | |
45 | - | if gameProcessedEvent then return end |
45 | + | |
46 | - | Event:FireServer({KeyCode=Input.KeyCode,UserInputType=Input.UserInputType,UserInputState=Input.UserInputState}) |
46 | + | |
47 | - | end |
47 | + | |
48 | - | Event.OnClientEvent:connect(function(Args) |
48 | + | |
49 | - | if Args[1] == "NewSound" then table.insert(Sounds,Args[2]) end |
49 | + | |
50 | - | end) |
50 | + | |
51 | - | UserInputService.InputBegan:Connect(Input);UserInputService.InputEnded:Connect(Input) |
51 | + | |
52 | - | local Hit,Target |
52 | + | |
53 | - | while wait(1/30) do |
53 | + | |
54 | - | for x,Sound in pairs(Sounds) do |
54 | + | |
55 | - | if Sound.Parent then Event:FireServer({["Sound"]=Sound,["Loudness"]=Sound.PlaybackLoudness}) end |
55 | + | |
56 | - | end |
56 | + | |
57 | - | if Hit ~= Mouse.Hit or Target ~= Mouse.Target then |
57 | + | |
58 | - | Hit = Mouse.Hit;Target = Mouse.Target; |
58 | + | |
59 | - | Event:FireServer({["MouseEvent"]=true,["Target"]=Target,["Hit"]=Hit}) |
59 | + | |
60 | - | end |
60 | + | |
61 | - | end |
61 | + | |
62 | - | ]],InternalData.RealOwner.Character) |
62 | + | |
63 | Mesh.Scale = Vector3.new(0.07,0.2,0.07) / 0.2 * math.random(-Scale,Scale) | |
64 | - | InternalData.NewOwner = setmetatable({},{ |
64 | + | |
65 | - | __index = function (self,Index) |
65 | + | |
66 | - | local Type = type(InternalData.RealOwner[Index]) |
66 | + | |
67 | - | if Type == "function" then |
67 | + | |
68 | - | if Index:lower() == "getmouse" or Index:lower() == "mouse" then |
68 | + | |
69 | - | return function (self)return InternalData["Mouse"] end |
69 | + | |
70 | - | end |
70 | + | |
71 | - | return function (self,...)return InternalData.RealOwner[Index](InternalData.RealOwner,...) end |
71 | + | |
72 | - | elseif Index == "FakePlayer" then |
72 | + | |
73 | - | return true |
73 | + | |
74 | - | end |
74 | + | |
75 | - | return InternalData.RealOwner[Index] |
75 | + | |
76 | - | end; |
76 | + | |
77 | - | __tostring = function(self) return tostring(InternalData.RealOwner) end |
77 | + | |
78 | - | }) |
78 | + | |
79 | - | InternalData.LoadLibrary = LoadLibrary;LoadLibrary = function(Library) |
79 | + | |
80 | - | if Library == "RbxUtility" then |
80 | + | |
81 | - | return setmetatable({},{ |
81 | + | |
82 | - | __tostring = function() return "RbxUtility" end; |
82 | + | |
83 | - | __index = function(self, Index) |
83 | + | |
84 | - | if Index:lower() == "create" then |
84 | + | |
85 | - | return function(Type) |
85 | + | |
86 | - | return function(Data) |
86 | + | |
87 | - | Data = Data or {} |
87 | + | |
88 | - | local Inst = Instance.new(Type) |
88 | + | |
89 | - | for x,y in pairs(Data) do |
89 | + | |
90 | - | if InternalData.RealObjs[y] then y = InternalData.RealObjs[y] end |
90 | + | |
91 | - | if y == owner then y = InternalData.RealOwner end |
91 | + | |
92 | - | Inst[x] = y |
92 | + | |
93 | - | end |
93 | + | |
94 | - | return Inst |
94 | + | |
95 | - | end |
95 | + | |
96 | - | end |
96 | + | |
97 | - | end |
97 | + | |
98 | - | return InternalData.LoadLibrary(Library)[Index] |
98 | + | |
99 | - | end |
99 | + | |
100 | - | }) |
100 | + | |
101 | - | end |
101 | + | |
102 | - | return InternalData.LoadLibrary(Library) |
102 | + | |
103 | Part.BrickColor = BrickColor.new("Black") | |
104 | - | InternalData.RealInstance = Instance;Instance = setmetatable({},{ |
104 | + | |
105 | - | __index = function (self,Index) |
105 | + | |
106 | - | if Index:lower() == 'new' then |
106 | + | |
107 | - | return function (Type, Parent) |
107 | + | |
108 | - | if Parent == owner then Parent = InternalData.RealOwner end |
108 | + | |
109 | - | if InternalData.RealObjs[Parent] then Parent = InternalData.RealObjs[Parent] end |
109 | + | |
110 | - | local Real = InternalData.RealInstance.new(Type,Parent) |
110 | + | |
111 | - | if not Type then return end |
111 | + | |
112 | - | if Type == "BillboardGui" then |
112 | + | |
113 | - | local ToReturn = setmetatable({},{ |
113 | + | |
114 | - | __index = function (self,Index) |
114 | + | |
115 | - | if type(Real[Index]) == "function" then |
115 | + | |
116 | - | if Index:lower() == "clone" then |
116 | + | |
117 | - | return function (self) |
117 | + | |
118 | - | local Real = Real:Clone() |
118 | + | |
119 | - | local ToReturn = setmetatable({RealObject = Real},{ |
119 | + | |
120 | - | __index = function (self,Index) |
120 | + | |
121 | - | if type(Real[Index]) == "function" then return function (self,...) return Real[Index](Real,...)end end |
121 | + | |
122 | - | return Real[Index] |
122 | + | |
123 | - | end; |
123 | + | |
124 | - | __newindex = function (self,Index,Value) |
124 | + | |
125 | - | if InternalData.RealObjs[Value] then Value = InternalData.RealObjs[Value] end |
125 | + | |
126 | - | if Value == owner then Value = InternalData.RealOwner end |
126 | + | |
127 | - | Real[Index] = Value |
127 | + | |
128 | - | end; |
128 | + | |
129 | - | __tostring = function(self) return tostring(Real) end; |
129 | + | |
130 | - | }) |
130 | + | |
131 | - | InternalData.RealObjs[ToReturn] = Real;return ToReturn; |
131 | + | |
132 | - | end |
132 | + | |
133 | - | end |
133 | + | |
134 | - | return function (self,...) return Real[Index](Real,...)end |
134 | + | |
135 | - | end |
135 | + | |
136 | - | return Real[Index] |
136 | + | |
137 | - | end; |
137 | + | |
138 | - | __newindex = function (self,Index,Value) |
138 | + | |
139 | - | if InternalData.RealObjs[Value] then Value = InternalData.RealObjs[Value] end |
139 | + | |
140 | - | if Value == owner then Value = InternalData.RealOwner end |
140 | + | |
141 | - | Real[Index] = Value |
141 | + | |
142 | - | end; |
142 | + | |
143 | - | __tostring = function(self) return tostring(Real) end; |
143 | + | |
144 | - | }) |
144 | + | |
145 | - | InternalData.RealObjs[ToReturn] = Real;return ToReturn; |
145 | + | |
146 | - | elseif Type:lower() == "sound" then |
146 | + | |
147 | - | Real.Parent = owner.Character; |
147 | + | |
148 | - | local ToReturn = setmetatable({RealObject = Real},{ |
148 | + | |
149 | - | __index = function (self,Index) |
149 | + | |
150 | - | if Index:lower() == "playbackloudness" then |
150 | + | |
151 | - | return InternalData.SoundLoudness[Real] or 0 |
151 | + | |
152 | - | elseif type(Real[Index]) == "function" then |
152 | + | |
153 | - | if Index:lower() == "clone" then |
153 | + | |
154 | - | return function (self) |
154 | + | |
155 | - | local Real = Real:Clone() |
155 | + | |
156 | - | local ToReturn = setmetatable({},{ |
156 | + | |
157 | - | __index = function (self,Index) |
157 | + | |
158 | - | if type(Real[Index]) == "function" then return function (self,...) return Real[Index](Real,...)end end |
158 | + | |
159 | - | return Real[Index] |
159 | + | |
160 | - | end; |
160 | + | |
161 | - | __newindex = function (self,Index,Value) |
161 | + | |
162 | - | if InternalData.RealObjs[Value] then Value = InternalData.RealObjs[Value] end |
162 | + | |
163 | - | if Value == owner then Value = InternalData.RealOwner end |
163 | + | |
164 | - | Real[Index] = Value |
164 | + | |
165 | - | end; |
165 | + | |
166 | - | __tostring = function(self) return tostring(Real) end; |
166 | + | |
167 | - | }) |
167 | + | |
168 | - | InternalData.RealObjs[ToReturn] = Real;return ToReturn; |
168 | + | |
169 | - | end |
169 | + | |
170 | - | end |
170 | + | |
171 | - | return function (self,...) return Real[Index](Real,...)end |
171 | + | |
172 | - | end |
172 | + | |
173 | - | return Real[Index] |
173 | + | |
174 | - | end; |
174 | + | |
175 | - | __newindex = function (self,Index,Value) |
175 | + | |
176 | - | if InternalData.RealObjs[Value] then Value = InternalData.RealObjs[Value] end |
176 | + | |
177 | - | if Value == owner then Value = InternalData.RealOwner end |
177 | + | |
178 | - | Real[Index] = Value |
178 | + | |
179 | - | end; |
179 | + | |
180 | - | __tostring = function(self) return tostring(Real) end; |
180 | + | |
181 | - | }) |
181 | + | |
182 | - | InternalData.RealObjs[ToReturn] = Real;InternalData.SoundLoudness[Real] = 0;repeat wait() until InternalData.Event.Parent InternalData.Event:FireClient(InternalData.RealOwner,{"NewSound",Real}) return ToReturn; |
182 | + | |
183 | - | else |
183 | + | |
184 | - | local ToReturn = setmetatable({RealObject = Real},{ |
184 | + | |
185 | - | __index = function (self,Index) |
185 | + | |
186 | - | if type(Real[Index]) == "function" then |
186 | + | |
187 | - | if Index:lower() == "clone" then |
187 | + | |
188 | - | return function (self) |
188 | + | |
189 | - | local Real = Real:Clone() |
189 | + | |
190 | - | local ToReturn = setmetatable({},{ |
190 | + | |
191 | - | __index = function (self,Index) |
191 | + | |
192 | - | if type(Real[Index]) == "function" then return function (self,...) return Real[Index](Real,...)end end |
192 | + | |
193 | - | return Real[Index] |
193 | + | |
194 | - | end; |
194 | + | |
195 | - | __newindex = function (self,Index,Value) |
195 | + | |
196 | - | if InternalData.RealObjs[Value] then Value = InternalData.RealObjs[Value] end |
196 | + | |
197 | - | if Value == owner then Value = InternalData.RealOwner end |
197 | + | |
198 | - | Real[Index] = Value |
198 | + | |
199 | - | end; |
199 | + | |
200 | - | __tostring = function(self) return tostring(Real) end; |
200 | + | |
201 | - | }) |
201 | + | |
202 | - | InternalData.RealObjs[ToReturn] = Real;return ToReturn; |
202 | + | |
203 | - | end |
203 | + | |
204 | - | end |
204 | + | |
205 | - | return function (self,...) return Real[Index](Real,...)end |
205 | + | |
206 | - | end |
206 | + | |
207 | - | return Real[Index] |
207 | + | |
208 | - | end; |
208 | + | |
209 | - | __newindex = function (self,Index,Value) |
209 | + | |
210 | - | if InternalData.RealObjs[Value] then Value = InternalData.RealObjs[Value] end |
210 | + | |
211 | - | if Value == owner then Value = InternalData.RealOwner end |
211 | + | |
212 | - | Real[Index] = Value |
212 | + | |
213 | - | end; |
213 | + | |
214 | - | __tostring = function(self) return tostring(Real) end; |
214 | + | |
215 | - | }) |
215 | + | |
216 | - | InternalData.RealObjs[ToReturn] = Real;return ToReturn; |
216 | + | |
217 | - | end |
217 | + | |
218 | - | end |
218 | + | |
219 | - | end |
219 | + | |
220 | - | return InternalData.RealInstance[Index] |
220 | + | |
221 | - | end; |
221 | + | |
222 | - | __tostring = function(self) return tostring(InternalData.RealInstance) end; |
222 | + | |
223 | - | }); |
223 | + | |
224 | - | InternalData.RealGame = game;game = setmetatable({},{ |
224 | + | |
225 | - | __index = function (self,Index) |
225 | + | |
226 | - | if InternalData.RealGame[Index] then |
226 | + | |
227 | - | local Type = type(InternalData.RealGame[Index]) |
227 | + | |
228 | - | if Type == "function" then |
228 | + | |
229 | - | if Index:lower() == "getservice" or Index:lower() == "service" then |
229 | + | |
230 | - | return function (self,Service) |
230 | + | |
231 | - | local FakeServices = { |
231 | + | |
232 | - | ["players"] = function() |
232 | + | |
233 | - | return setmetatable({},{ |
233 | + | |
234 | - | __index = function (self2,Index2) |
234 | + | |
235 | - | local RealService = InternalData.RealGame:GetService(Service) |
235 | + | |
236 | - | local Type2 = type(RealService[Index2]) |
236 | + | |
237 | - | if Type2 == "function" then |
237 | + | |
238 | - | return function (self,...) return RealService[Index2](RealService,...)end |
238 | + | |
239 | - | else |
239 | + | |
240 | - | if Index2:lower() == "localplayer" then return InternalData.NewOwner end |
240 | + | |
241 | - | return RealService[Index2] |
241 | + | |
242 | - | end |
242 | + | |
243 | - | end; |
243 | + | |
244 | - | __tostring = function(self) return tostring(InternalData.RealGame:GetService(Service)) end |
244 | + | |
245 | - | }) |
245 | + | |
246 | - | end; |
246 | + | |
247 | - | ["contextactionservice"] = function() return InternalData["ContextActionService"] end; |
247 | + | |
248 | - | ["userinputservice"] = function() return InternalData["UserInputService"] end; |
248 | + | |
249 | - | ["debris"] = function() |
249 | + | |
250 | - | return setmetatable({},{ |
250 | + | |
251 | - | __index = function(self2,Index2) |
251 | + | |
252 | - | local RealService = InternalData.RealGame:GetService(Service) |
252 | + | |
253 | - | local Type2 = type(RealService[Index2]) |
253 | + | |
254 | - | if Type2 == "function" then |
254 | + | |
255 | - | if Index2:lower() == "additem" then |
255 | + | |
256 | - | return function (self,Item,Time) |
256 | + | |
257 | - | if InternalData.RealObjs[Item] then Item = InternalData.RealObjs[Item] end |
257 | + | |
258 | - | return RealService:AddItem(Item,Time) |
258 | + | |
259 | - | end |
259 | + | |
260 | - | end |
260 | + | |
261 | - | return function (self,...) return RealService[Index2](RealService,...) end |
261 | + | |
262 | - | end |
262 | + | |
263 | - | return RealService[Index2] |
263 | + | |
264 | - | end; |
264 | + | |
265 | - | __tostring = function(self) return tostring(InternalData.RealGame:GetService("Debris")) end |
265 | + | |
266 | - | }) |
266 | + | |
267 | - | end; |
267 | + | |
268 | - | ["runservice"] = function() |
268 | + | |
269 | - | return setmetatable({},{ |
269 | + | |
270 | - | __index = function(self2,Index2) |
270 | + | |
271 | - | local RealService = InternalData.RealGame:GetService(Service) |
271 | + | |
272 | - | local Type2 = type(RealService[Index2]) |
272 | + | |
273 | - | if Type2 == "function" then |
273 | + | |
274 | - | return function (self,...) return RealService[Index2](RealService,...) end |
274 | + | |
275 | - | else |
275 | + | |
276 | - | local RunServices = { |
276 | + | |
277 | - | ["bindtorenderstep"] = function() return function (self,Name,Priority,Function) return InternalData.RealGame:GetService("RunService").Stepped:Connect(Function) end end; |
277 | + | |
278 | - | ["renderstepped"] = function() return RealService["Stepped"] end |
278 | + | |
279 | - | } |
279 | + | |
280 | - | if RunServices[Index2:lower()] then return RunServices[Index2:lower()]() end |
280 | + | |
281 | - | return RealService[Index2] |
281 | + | |
282 | - | end |
282 | + | |
283 | - | end; |
283 | + | |
284 | - | __tostring = function(self) return tostring(InternalData.RealGame:GetService("RunService")) end |
284 | + | |
285 | - | }) |
285 | + | |
286 | - | end |
286 | + | |
287 | - | } |
287 | + | |
288 | - | if FakeServices[Service:lower()] then return FakeServices[Service:lower()]() end |
288 | + | |
289 | - | return InternalData.RealGame:GetService(Service) |
289 | + | |
290 | - | end |
290 | + | |
291 | - | end |
291 | + | |
292 | - | return function (self,...) return InternalData.RealGame[Index](InternalData.RealGame,...) end |
292 | + | |
293 | - | else |
293 | + | |
294 | - | if game:GetService(Index) then return game:GetService(Index) end |
294 | + | |
295 | - | return InternalData.RealGame[Index] |
295 | + | |
296 | - | end |
296 | + | |
297 | - | end |
297 | + | |
298 | - | return nil |
298 | + | |
299 | - | end; |
299 | + | |
300 | - | __tostring = function(self) return tostring(InternalData.game) end |
300 | + | |
301 | - | });Game = game;owner = game:GetService("Players").LocalPlayer;script = Instance.new("Script");print("Complete!") |
301 | + | |
302 | - | |
302 | + | |
303 | - | --//Paste script below this line. |
303 | + | |
304 | ||
305 | local Barrel2 = Instance.new("Part",Model) | |
306 | Barrel2.CanCollide = false | |
307 | Barrel2.Position = Vector3.new(0,100,0) | |
308 | Barrel2:BreakJoints() | |
309 | Barrel2.FormFactor = "Custom" | |
310 | Barrel2.Size = Vector3.new(0.2,0.2,0.2) | |
311 | Barrel2.TopSurface = "SmoothNoOutlines" | |
312 | Barrel2.BottomSurface = "SmoothNoOutlines" | |
313 | Barrel2.FrontSurface = "SmoothNoOutlines" | |
314 | Barrel2.BackSurface = "SmoothNoOutlines" | |
315 | Barrel2.RightSurface = "SmoothNoOutlines" | |
316 | Barrel2.LeftSurface = "SmoothNoOutlines" | |
317 | Barrel2.BrickColor = BrickColor.new("Really black") | |
318 | local Mesh = Instance.new("BlockMesh",Barrel2) | |
319 | Mesh.Scale = Vector3.new(0.25,0.25,2) / 0.2 * Scale | |
320 | local Barrel2Weld = Instance.new("Motor6D") | |
321 | Barrel2Weld.Part0 = Barrel | |
322 | Barrel2Weld.Part1 = Barrel2 | |
323 | Barrel2Weld.C0 = CFrame.new(Vector3.new(0,0.225,0)*Scale) | |
324 | Barrel2Weld.Parent = Barrel2 | |
325 | ||
326 | local RealBarrel = Instance.new("Part",Model) | |
327 | RealBarrel.CanCollide = false | |
328 | RealBarrel.Position = Vector3.new(0,100,0) | |
329 | RealBarrel:BreakJoints() | |
330 | RealBarrel.FormFactor = "Custom" | |
331 | RealBarrel.Size = Vector3.new(0.2,0.2,0.2) | |
332 | RealBarrel.TopSurface = "SmoothNoOutlines" | |
333 | RealBarrel.BottomSurface = "SmoothNoOutlines" | |
334 | RealBarrel.FrontSurface = "SmoothNoOutlines" | |
335 | RealBarrel.BackSurface = "SmoothNoOutlines" | |
336 | RealBarrel.RightSurface = "SmoothNoOutlines" | |
337 | RealBarrel.LeftSurface = "SmoothNoOutlines" | |
338 | RealBarrel.BrickColor = BrickColor.new("Dark grey metallic") | |
339 | local Mesh = Instance.new("CylinderMesh",RealBarrel) | |
340 | Mesh.Scale = Vector3.new(0.2,2,0.2) / 0.2 * Scale | |
341 | local RealBarrelWeld = Instance.new("Motor6D") | |
342 | RealBarrelWeld.Part0 = Barrel | |
343 | RealBarrelWeld.Part1 = RealBarrel | |
344 | RealBarrelWeld.C0 = CFrame.new(Vector3.new(0,0.1,-0.01)*Scale) * CFrame.Angles(math.rad(-90),0,0) | |
345 | RealBarrelWeld.Parent = RealBarrel | |
346 | ||
347 | for i = 1,75,15 do | |
348 | local Part = Instance.new("Part",Model) | |
349 | Part.CanCollide = false | |
350 | Part.Position = Vector3.new(0,100,0) | |
351 | Part:BreakJoints() | |
352 | Part.FormFactor = "Custom" | |
353 | Part.Size = Vector3.new(0.2,0.2,0.2) | |
354 | Part.TopSurface = "SmoothNoOutlines" | |
355 | Part.BottomSurface = "SmoothNoOutlines" | |
356 | Part.FrontSurface = "SmoothNoOutlines" | |
357 | Part.BackSurface = "SmoothNoOutlines" | |
358 | Part.RightSurface = "SmoothNoOutlines" | |
359 | Part.LeftSurface = "SmoothNoOutlines" | |
360 | Part.BrickColor = BrickColor.new("Black") | |
361 | local Mesh = Instance.new("BlockMesh",Part) | |
362 | Mesh.Scale = Vector3.new(0.05,0.065,0.05) / 0.2 * Scale | |
363 | local PartWeld = Instance.new("Motor6D") | |
364 | PartWeld.Part0 = Handle | |
365 | PartWeld.Part1 = Part | |
366 | PartWeld.C0 = CFrame.new(Vector3.new(0,0.525,-0.515)*Scale) * CFrame.Angles(math.rad(i),0,0) * CFrame.new(Vector3.new(0,0,0.2)*Scale) | |
367 | PartWeld.Parent = Part | |
368 | end | |
369 | ||
370 | local Part = Instance.new("Part",Model) | |
371 | Part.CanCollide = false | |
372 | Part.Position = Vector3.new(0,100,0) | |
373 | Part:BreakJoints() | |
374 | Part.FormFactor = "Custom" | |
375 | Part.Size = Vector3.new(0.2,0.2,0.2) | |
376 | Part.TopSurface = "SmoothNoOutlines" | |
377 | Part.BottomSurface = "SmoothNoOutlines" | |
378 | Part.FrontSurface = "SmoothNoOutlines" | |
379 | Part.BackSurface = "SmoothNoOutlines" | |
380 | Part.RightSurface = "SmoothNoOutlines" | |
381 | Part.LeftSurface = "SmoothNoOutlines" | |
382 | Part.BrickColor = BrickColor.new("Really black") | |
383 | local Mesh = Instance.new("BlockMesh",Part) | |
384 | Mesh.Scale = Vector3.new(0.05,0.11,0.1) / 0.2 * Scale | |
385 | local PartWeld = Instance.new("Motor6D") | |
386 | PartWeld.Part0 = Barrel2 | |
387 | PartWeld.Part1 = Part | |
388 | PartWeld.C0 = CFrame.new(Vector3.new(0.06,0.135,0.925)*Scale) | |
389 | PartWeld.Parent = Part | |
390 | ||
391 | local Part = Instance.new("Part",Model) | |
392 | Part.CanCollide = false | |
393 | Part.Position = Vector3.new(0,100,0) | |
394 | Part:BreakJoints() | |
395 | Part.FormFactor = "Custom" | |
396 | Part.Size = Vector3.new(0.2,0.2,0.2) | |
397 | Part.TopSurface = "SmoothNoOutlines" | |
398 | Part.BottomSurface = "SmoothNoOutlines" | |
399 | Part.FrontSurface = "SmoothNoOutlines" | |
400 | Part.BackSurface = "SmoothNoOutlines" | |
401 | Part.RightSurface = "SmoothNoOutlines" | |
402 | Part.LeftSurface = "SmoothNoOutlines" | |
403 | Part.BrickColor = BrickColor.new("Really black") | |
404 | local Mesh = Instance.new("BlockMesh",Part) | |
405 | Mesh.Scale = Vector3.new(0.05,0.11,0.1) / 0.2 * Scale | |
406 | local PartWeld = Instance.new("Motor6D") | |
407 | PartWeld.Part0 = Barrel2 | |
408 | PartWeld.Part1 = Part | |
409 | PartWeld.C0 = CFrame.new(Vector3.new(-0.06,0.135,0.925)*Scale) | |
410 | PartWeld.Parent = Part | |
411 | ||
412 | local Part = Instance.new("Part",Model) | |
413 | Part.CanCollide = false | |
414 | Part.Position = Vector3.new(0,100,0) | |
415 | Part:BreakJoints() | |
416 | Part.FormFactor = "Custom" | |
417 | Part.Size = Vector3.new(0.2,0.2,0.2) | |
418 | Part.TopSurface = "SmoothNoOutlines" | |
419 | Part.BottomSurface = "SmoothNoOutlines" | |
420 | Part.FrontSurface = "SmoothNoOutlines" | |
421 | Part.BackSurface = "SmoothNoOutlines" | |
422 | Part.RightSurface = "SmoothNoOutlines" | |
423 | Part.LeftSurface = "SmoothNoOutlines" | |
424 | Part.BrickColor = BrickColor.new("Really black") | |
425 | local Mesh = Instance.new("BlockMesh",Part) | |
426 | Mesh.Scale = Vector3.new(0.025,0.1,0.1) / 0.2 * Scale | |
427 | local PartWeld = Instance.new("Motor6D") | |
428 | PartWeld.Part0 = Barrel2 | |
429 | PartWeld.Part1 = Part | |
430 | PartWeld.C0 = CFrame.new(Vector3.new(0,0.135,-0.925)*Scale) | |
431 | PartWeld.Parent = Part | |
432 | ||
433 | local Part = Instance.new("Part",Model) | |
434 | Part.CanCollide = false | |
435 | Part.Position = Vector3.new(0,100,0) | |
436 | Part:BreakJoints() | |
437 | Part.FormFactor = "Custom" | |
438 | Part.Size = Vector3.new(0.2,0.2,0.2) | |
439 | Part.Transparency = 1 | |
440 | Part.TopSurface = "SmoothNoOutlines" | |
441 | Part.BottomSurface = "SmoothNoOutlines" | |
442 | Part.FrontSurface = "SmoothNoOutlines" | |
443 | Part.BackSurface = "SmoothNoOutlines" | |
444 | Part.RightSurface = "SmoothNoOutlines" | |
445 | Part.LeftSurface = "SmoothNoOutlines" | |
446 | Part.BrickColor = BrickColor.new("Really black") | |
447 | local Mesh = Instance.new("BlockMesh",Part) | |
448 | Mesh.Scale = Vector3.new(0.1,0.1,0.1) / 0.2 * Scale | |
449 | local PartWeld = Instance.new("Motor6D") | |
450 | PartWeld.Part0 = Barrel | |
451 | PartWeld.Part1 = Part | |
452 | PartWeld.C0 = CFrame.new(Vector3.new(0,0,-5)*Scale) | |
453 | PartWeld.Parent = Part | |
454 | ||
455 | local Light = Instance.new("PointLight",Part) | |
456 | Light.Color = BrickColor.new("Gold").Color | |
457 | Light.Enabled = true | |
458 | Light.Shadows = true | |
459 | Light.Brightness = 0 | |
460 | Light.Range = 6 | |
461 | ||
462 | local Part = Instance.new("Part",Model) | |
463 | Part.Material = "Neon" | |
464 | Part.CanCollide = false | |
465 | Part.Position = Vector3.new(0,100,0) | |
466 | Part:BreakJoints() | |
467 | Part.FormFactor = "Custom" | |
468 | Part.Size = Vector3.new(0.2,0.2,0.2) | |
469 | Part.TopSurface = "SmoothNoOutlines" | |
470 | Part.BottomSurface = "SmoothNoOutlines" | |
471 | Part.FrontSurface = "SmoothNoOutlines" | |
472 | Part.BackSurface = "SmoothNoOutlines" | |
473 | Part.RightSurface = "SmoothNoOutlines" | |
474 | Part.LeftSurface = "SmoothNoOutlines" | |
475 | Part.BrickColor = BrickColor.new("Bright yellow") | |
476 | Part.Transparency = 0.25 | |
477 | local RecoilMesh = Instance.new("SpecialMesh",Part) | |
478 | RecoilMesh.MeshType = "FileMesh" | |
479 | RecoilMesh.MeshId = "http://www.roblox.com/Asset/?id=1323306" | |
480 | RecoilMesh.TextureId = "http://www.roblox.com/Asset/?id=98896228" | |
481 | RecoilMesh.Scale = Vector3.new(0.175,0,0.175) * Scale | |
482 | local PartWeld = Instance.new("Motor6D") | |
483 | PartWeld.Part0 = RealBarrel | |
484 | PartWeld.Part1 = Part | |
485 | PartWeld.C0 = CFrame.new(Vector3.new(0,0.95,0)*Scale) | |
486 | PartWeld.Parent = Part | |
487 | ||
488 | function ShootBullet(Target,barrel) | |
489 | coroutine.resume(coroutine.create(function() | |
490 | local barrel = barrel or Barrel | |
491 | local Bullet = Instance.new("Part",Workspace) | |
492 | Barrel.CanCollide = false | |
493 | Bullet.FormFactor = "Custom" | |
494 | Bullet.Size = Vector3.new(math.random(5,10)/10,math.random(5,10)/10,math.random(30,50)/10) | |
495 | Bullet.TopSurface = "Smooth" | |
496 | Bullet.BottomSurface = "Smooth" | |
497 | Bullet.Anchored = false | |
498 | Bullet.CanCollide = true | |
499 | Bullet.CFrame = CFrame.new((barrel.CFrame*CFrame.new(0,0,-barrel.Size.Z*barrel.Mesh.Scale.Z/2)).p,Target)*CFrame.new(0,0,-Bullet.Size.Z/2) | |
500 | Bullet.BrickColor = BrickColor.new("Gold") | |
501 | Bullet:BreakJoints() | |
502 | IgnoreList[#IgnoreList+1] = Bullet | |
503 | Bullet.Touched:Connect(function(hit) | |
504 | hit:Explode() | |
505 | end) | |
506 | RenderStepped:wait() | |
507 | for i = 1,75,1 do -- Loop to do the bullet movement and stuff. | |
508 | Bullet.CFrame = Bullet.CFrame*CFrame.Angles(math.random(-10,10)/10,math.random(-10,10)/10,math.random(-10,10)/10)*CFrame.new(0,0,-Speed/1.2) | |
509 | RenderStepped:wait() | |
510 | end | |
511 | Bullet:Destroy() | |
512 | end)) | |
513 | end | |
514 | ||
515 | Mouse.Button1Down:connect(function() | |
516 | if not Down and not DB then | |
517 | Down = true | |
518 | while Down do | |
519 | if Humanoid.Health == 0 then break end | |
520 | if not DB then | |
521 | DB = true | |
522 | coroutine.resume(coroutine.create(function() | |
523 | for i = 1,4 do | |
524 | ShootBullet(Mouse.Hit.p,Barrel1) | |
525 | end | |
526 | end)) | |
527 | RecoilMesh.VertexColor = Vector3.new(1,math.random(160,245)/255,20/255) | |
528 | PartWeld.C0 = PartWeld.C0 * CFrame.Angles(0,math.rad(math.random(-40,40)),0) | |
529 | local Shell = Instance.new("Part",Workspace) | |
530 | Shell.FormFactor = "Custom" | |
531 | Shell.BrickColor = BrickColor.new("Bright yellow") | |
532 | Shell.Size = Vector3.new(5,1,5)*Scale | |
533 | Shell.CFrame = Barrel.CFrame*CFrame.new(0.5,0.5,0)*CFrame.Angles(math.rad(-90),0,0) | |
534 | Shell.Velocity = ((Barrel.CFrame*CFrame.new(5,0,math.random(-2,2))).p-Barrel.CFrame.p)*5*Scale | |
535 | Spawn(function() | |
536 | wait(5) | |
537 | Shell:Destroy() | |
538 | end) | |
539 | RenderStepped:wait() | |
540 | DB = false | |
541 | end | |
542 | end | |
543 | end | |
544 | end) | |
545 | ||
546 | Mouse.Button1Up:connect(function() | |
547 | Down = false | |
548 | end) | |
549 | ||
550 | local Weld = Instance.new("Weld") | |
551 | Weld.Part0 = Torso | |
552 | Weld.Part1 = Character["Right Arm"] | |
553 | Weld.Parent = Torso | |
554 | ||
555 | local Weld2 = Instance.new("Weld") | |
556 | Weld2.Part0 = Torso | |
557 | Weld2.Part1 = Character.Head | |
558 | Weld2.Parent = Torso | |
559 | ||
560 | local RA = Character["Right Arm"] | |
561 | local bestweld = Instance.new("Weld",Character) | |
562 | bestweld.Part0 = Character.Torso | |
563 | bestweld.Part1 = RA | |
564 | bestweld.C1 = CFrame.new(0,-.5,0) | |
565 | bestweld.C0 = CFrame.new(1.5,-.5,0) | |
566 | while true do | |
567 | Gravity = math.random(-1,1)*100 | |
568 | for i,v in pairs(game.Players.LocalPlayer.Character:GetDescendants()) do | |
569 | if v:IsA("Part") and v.Name ~= "Head" and v.Parent.ClassName ~= "Accessory" then | |
570 | v.LocalTransparencyModifier = 0 | |
571 | end | |
572 | end | |
573 | for i,v in pairs(Character:GetDescendants()) do | |
574 | if v:IsA("BlockMesh") or v:IsA("CylinderMesh") then | |
575 | v.Scale = v.Scale:Lerp(Vector3.new(math.random(3,20)/10,math.random(3,20)/10,math.random(3,20)/10),.3) | |
576 | v.Offset = v.Offset:Lerp(Vector3.new(math.random(3,20)/10,math.random(3,20)/10,math.random(3,20)/10),.3) | |
577 | end | |
578 | end | |
579 | local CFr = CFrame.new(math.random(-10,10)/10,math.random(-10,10)/10,math.random(-10,10)/10) * CFrame.Angles(math.random(-10,10)/10,math.random(-10,10)/10,math.random(-10,10)/10) | |
580 | Weld.C0 = Weld.C0:Lerp(Part0Joint * CFr,.3) | |
581 | Weld.C1 = Part1Joint | |
582 | Weld.Part0 = Torso | |
583 | Weld.Part1 = RA | |
584 | local CFr = CFrame.new(math.random(-10,10)/10,math.random(-10,10)/10,math.random(-10,10)/10) * CFrame.Angles(math.random(-10,10)/10,math.random(-10,10)/10,math.random(-10,10)/10) | |
585 | Weld2.C0 = Weld2.C0:Lerp(Part0Joint * CFr,.3) | |
586 | Weld2.C1 = Part1JointHead | |
587 | Weld2.Part0 = Torso | |
588 | Weld2.Part1 = Character.Head | |
589 | local Last = Scale | |
590 | Speed = 5 | |
591 | bestweld.C0 = bestweld.C0:Lerp(CFrame.new(math.random(-15,15)/10,math.random(-5,5)/10,0) * CFrame.Angles(math.random(-15,15)/10,math.random(-15,15)/10,math.random(-15,15)/10),.3) | |
592 | HandleWeld.C0 = HandleWeld.C0:Lerp(CFrame.new(math.random(-20,20)/10,math.random(-20,20)/10,math.random(-20,20)/10) * CFrame.Angles(math.random(-20,20)/10,math.random(-20,20)/10,math.random(-20,20)/10),.3) | |
593 | game:GetService("RunService").Stepped:Wait() | |
594 | end |