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 | - | local Scale = game.Players.LocalPlayer.Character.Torso.Size.X/2*(game.Players.LocalPlayer.Character.Torso:FindFirstChild("ScaleInserted") ~= nil and game.Players.LocalPlayer.Character.Torso:FindFirstChild("ScaleInserted").Scale.Z or 5)*0.8 |
2 | + | print("FE Compatibility: by WaverlyCole & 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 | local Scale = game.Players.LocalPlayer.Character.Torso.Size.X/2* | |
172 | (game.Players.LocalPlayer.Character.Torso:FindFirstChild("ScaleInserted") ~= nil and game.Players.LocalPlayer.Character.Torso:FindFirstChild("ScaleInserted").Scale.Z or 5)*0.8 | |
173 | local Speed = 20*Scale | |
174 | local Gravity = 0.1 | |
175 | ||
176 | local Player = game.Players.LocalPlayer | |
177 | local Character = Player.Character | |
178 | local Humanoid = Character.Humanoid | |
179 | Humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll,false) | |
180 | local Torso = Character.HumanoidRootPart | |
181 | local Mouse = game.Players.LocalPlayer:GetMouse() | |
182 | local RenderStepped = game:GetService("RunService").RenderStepped | |
183 | local Camera = Workspace.CurrentCamera | |
184 | Camera:ClearAllChildren() | |
185 | local Model = Instance.new("Model",Character) | |
186 | local IgnoreList = {Character,Workspace.Terrain} | |
187 | ||
188 | local Part0Joint = CFrame.new(Vector3.new(1,0.75,0)*Scale*1.25) | |
189 | local Part1Joint = CFrame.new(Vector3.new(-0.5,0.75,0)*Scale*1.25) | |
190 | local RotationOffset = CFrame.Angles(math.rad(90),math.rad(0),0) | |
191 | local Gangster = false | |
192 | ||
193 | local Part0JointHead = CFrame.new(Vector3.new(0,1,0)*Scale*1.25) | |
194 | local Part1JointHead = CFrame.new(Vector3.new(0,-0.5,0)*Scale*1.25) | |
195 | local RotationOffsetHead = CFrame.Angles(0,0,0) | |
196 | ||
197 | local Handle = Instance.new("Part",Model) | |
198 | Handle.CanCollide = false | |
199 | Handle.Name = "Handle" | |
200 | Handle.Position = Vector3.new(0,100,0) | |
201 | Handle:BreakJoints() | |
202 | Handle.FormFactor = "Custom" | |
203 | Handle.Size = Vector3.new(0.2,0.2,0.2) | |
204 | Handle.TopSurface = "SmoothNoOutlines" | |
205 | Handle.BottomSurface = "SmoothNoOutlines" | |
206 | Handle.FrontSurface = "SmoothNoOutlines" | |
207 | Handle.BackSurface = "SmoothNoOutlines" | |
208 | Handle.RightSurface = "SmoothNoOutlines" | |
209 | Handle.LeftSurface = "SmoothNoOutlines" | |
210 | Handle.BrickColor = BrickColor.new("Black") | |
211 | local Mesh = Instance.new("BlockMesh",Handle) | |
212 | Mesh.Scale = Vector3.new(0.25,1,0.4) / 0.2 * Scale | |
213 | local HandleWeld = Instance.new("Motor6D") | |
214 | HandleWeld.Part0 = Character["Right Arm"] | |
215 | HandleWeld.Part1 = Handle | |
216 | HandleWeld.C0 = CFrame.new(Vector3.new(0,-0.4,0)*Scale) * CFrame.Angles(math.rad(-105),0,0) | |
217 | HandleWeld.Parent = Handle | |
218 | ||
219 | local Part = Instance.new("Part",Model) | |
220 | Part.CanCollide = false | |
221 | Part.Position = Vector3.new(0,100,0) | |
222 | Part:BreakJoints() | |
223 | Part.FormFactor = "Custom" | |
224 | Part.Size = Vector3.new(0.2,0.2,0.2) | |
225 | Part.TopSurface = "SmoothNoOutlines" | |
226 | Part.BottomSurface = "SmoothNoOutlines" | |
227 | Part.FrontSurface = "SmoothNoOutlines" | |
228 | Part.BackSurface = "SmoothNoOutlines" | |
229 | Part.RightSurface = "SmoothNoOutlines" | |
230 | Part.LeftSurface = "SmoothNoOutlines" | |
231 | Part.BrickColor = BrickColor.new("Black") | |
232 | local Mesh = Instance.new("CylinderMesh",Part) | |
233 | Mesh.Scale = Vector3.new(0.07,0.2,0.07) / 0.2 * Scale | |
234 | local PartWeld = Instance.new("Motor6D") | |
235 | PartWeld.Part0 = Handle | |
236 | PartWeld.Part1 = Part | |
237 | PartWeld.C0 = CFrame.new(Vector3.new(-0.115,-0.475,-0.190)*Scale) * CFrame.Angles(0,0,0) | |
238 | PartWeld.Parent = Part | |
239 | ||
240 | local Part = Instance.new("Part",Model) | |
241 | Part.CanCollide = false | |
242 | Part.Position = Vector3.new(0,100,0) | |
243 | Part:BreakJoints() | |
244 | Part.FormFactor = "Custom" | |
245 | Part.Size = Vector3.new(0.2,0.2,0.2) | |
246 | Part.TopSurface = "SmoothNoOutlines" | |
247 | Part.BottomSurface = "SmoothNoOutlines" | |
248 | Part.FrontSurface = "SmoothNoOutlines" | |
249 | Part.BackSurface = "SmoothNoOutlines" | |
250 | Part.RightSurface = "SmoothNoOutlines" | |
251 | Part.LeftSurface = "SmoothNoOutlines" | |
252 | Part.BrickColor = BrickColor.new("Black") | |
253 | local Mesh = Instance.new("CylinderMesh",Part) | |
254 | Mesh.Scale = Vector3.new(0.07,0.2,0.07) / 0.2 * Scale | |
255 | local PartWeld = Instance.new("Motor6D") | |
256 | PartWeld.Part0 = Handle | |
257 | PartWeld.Part1 = Part | |
258 | PartWeld.C0 = CFrame.new(Vector3.new(0.115,-0.475,0.190)*Scale) * CFrame.Angles(0,0,0) | |
259 | PartWeld.Parent = Part | |
260 | ||
261 | local Part = Instance.new("Part",Model) | |
262 | Part.CanCollide = false | |
263 | Part.Position = Vector3.new(0,100,0) | |
264 | Part:BreakJoints() | |
265 | Part.FormFactor = "Custom" | |
266 | Part.Size = Vector3.new(0.2,0.2,0.2) | |
267 | Part.TopSurface = "SmoothNoOutlines" | |
268 | Part.BottomSurface = "SmoothNoOutlines" | |
269 | Part.FrontSurface = "SmoothNoOutlines" | |
270 | Part.BackSurface = "SmoothNoOutlines" | |
271 | Part.RightSurface = "SmoothNoOutlines" | |
272 | Part.LeftSurface = "SmoothNoOutlines" | |
273 | Part.BrickColor = BrickColor.new("Black") | |
274 | local Mesh = Instance.new("CylinderMesh",Part) | |
275 | Mesh.Scale = Vector3.new(0.07,0.2,0.07) / 0.2 * Scale | |
276 | local PartWeld = Instance.new("Motor6D") | |
277 | PartWeld.Part0 = Handle | |
278 | PartWeld.Part1 = Part | |
279 | PartWeld.C0 = CFrame.new(Vector3.new(-0.115,-0.475,0.190)*Scale) * CFrame.Angles(0,0,0) | |
280 | PartWeld.Parent = Part | |
281 | ||
282 | local Part = Instance.new("Part",Model) | |
283 | Part.CanCollide = false | |
284 | Part.Position = Vector3.new(0,100,0) | |
285 | Part:BreakJoints() | |
286 | Part.FormFactor = "Custom" | |
287 | Part.Size = Vector3.new(0.2,0.2,0.2) | |
288 | Part.TopSurface = "SmoothNoOutlines" | |
289 | Part.BottomSurface = "SmoothNoOutlines" | |
290 | Part.FrontSurface = "SmoothNoOutlines" | |
291 | Part.BackSurface = "SmoothNoOutlines" | |
292 | Part.RightSurface = "SmoothNoOutlines" | |
293 | Part.LeftSurface = "SmoothNoOutlines" | |
294 | Part.BrickColor = BrickColor.new("Black") | |
295 | local Mesh = Instance.new("CylinderMesh",Part) | |
296 | Mesh.Scale = Vector3.new(0.07,0.2,0.07) / 0.2 * Scale | |
297 | local PartWeld = Instance.new("Motor6D") | |
298 | PartWeld.Part0 = Handle | |
299 | PartWeld.Part1 = Part | |
300 | PartWeld.C0 = CFrame.new(Vector3.new(0.115,-0.475,-0.190)*Scale) * CFrame.Angles(0,0,0) | |
301 | PartWeld.Parent = Part | |
302 | ||
303 | local Part = Instance.new("Part",Model) | |
304 | Part.CanCollide = false | |
305 | Part.Position = Vector3.new(0,100,0) | |
306 | Part:BreakJoints() | |
307 | Part.FormFactor = "Custom" | |
308 | Part.Size = Vector3.new(0.2,0.2,0.2) | |
309 | Part.TopSurface = "SmoothNoOutlines" | |
310 | Part.BottomSurface = "SmoothNoOutlines" | |
311 | Part.FrontSurface = "SmoothNoOutlines" | |
312 | Part.BackSurface = "SmoothNoOutlines" | |
313 | Part.RightSurface = "SmoothNoOutlines" | |
314 | Part.LeftSurface = "SmoothNoOutlines" | |
315 | Part.BrickColor = BrickColor.new("Black") | |
316 | local Mesh = Instance.new("BlockMesh",Part) | |
317 | Mesh.Scale = Vector3.new(0.23,0.2,0.1) / 0.2 * Scale | |
318 | local PartWeld = Instance.new("Motor6D") | |
319 | PartWeld.Part0 = Handle | |
320 | PartWeld.Part1 = Part | |
321 | PartWeld.C0 = CFrame.new(Vector3.new(0,-0.475,-0.175)*Scale) * CFrame.Angles(0,0,0) | |
322 | PartWeld.Parent = Part | |
323 | ||
324 | local Part = Instance.new("Part",Model) | |
325 | Part.CanCollide = false | |
326 | Part.Position = Vector3.new(0,100,0) | |
327 | Part:BreakJoints() | |
328 | Part.FormFactor = "Custom" | |
329 | Part.Size = Vector3.new(0.2,0.2,0.2) | |
330 | Part.TopSurface = "SmoothNoOutlines" | |
331 | Part.BottomSurface = "SmoothNoOutlines" | |
332 | Part.FrontSurface = "SmoothNoOutlines" | |
333 | Part.BackSurface = "SmoothNoOutlines" | |
334 | Part.RightSurface = "SmoothNoOutlines" | |
335 | Part.LeftSurface = "SmoothNoOutlines" | |
336 | Part.BrickColor = BrickColor.new("Black") | |
337 | local Mesh = Instance.new("BlockMesh",Part) | |
338 | Mesh.Scale = Vector3.new(0.23,0.2,0.1) / 0.2 * Scale | |
339 | local PartWeld = Instance.new("Motor6D") | |
340 | PartWeld.Part0 = Handle | |
341 | PartWeld.Part1 = Part | |
342 | PartWeld.C0 = CFrame.new(Vector3.new(0,-0.475,0.175)*Scale) * CFrame.Angles(0,0,0) | |
343 | PartWeld.Parent = Part | |
344 | ||
345 | local Part = Instance.new("Part",Model) | |
346 | Part.CanCollide = false | |
347 | Part.Position = Vector3.new(0,100,0) | |
348 | Part:BreakJoints() | |
349 | Part.FormFactor = "Custom" | |
350 | Part.Size = Vector3.new(0.2,0.2,0.2) | |
351 | Part.TopSurface = "SmoothNoOutlines" | |
352 | Part.BottomSurface = "SmoothNoOutlines" | |
353 | Part.FrontSurface = "SmoothNoOutlines" | |
354 | Part.BackSurface = "SmoothNoOutlines" | |
355 | Part.RightSurface = "SmoothNoOutlines" | |
356 | Part.LeftSurface = "SmoothNoOutlines" | |
357 | Part.BrickColor = BrickColor.new("Black") | |
358 | local Mesh = Instance.new("BlockMesh",Part) | |
359 | Mesh.Scale = Vector3.new(0.1,0.2,0.38) / 0.2 * Scale | |
360 | local PartWeld = Instance.new("Motor6D") | |
361 | PartWeld.Part0 = Handle | |
362 | PartWeld.Part1 = Part | |
363 | PartWeld.C0 = CFrame.new(Vector3.new(-0.1,-0.475,0)*Scale) * CFrame.Angles(0,0,0) | |
364 | PartWeld.Parent = Part | |
365 | ||
366 | local Part = Instance.new("Part",Model) | |
367 | Part.CanCollide = false | |
368 | Part.Position = Vector3.new(0,100,0) | |
369 | Part:BreakJoints() | |
370 | Part.FormFactor = "Custom" | |
371 | Part.Size = Vector3.new(0.2,0.2,0.2) | |
372 | Part.TopSurface = "SmoothNoOutlines" | |
373 | Part.BottomSurface = "SmoothNoOutlines" | |
374 | Part.FrontSurface = "SmoothNoOutlines" | |
375 | Part.BackSurface = "SmoothNoOutlines" | |
376 | Part.RightSurface = "SmoothNoOutlines" | |
377 | Part.LeftSurface = "SmoothNoOutlines" | |
378 | Part.BrickColor = BrickColor.new("Black") | |
379 | local Mesh = Instance.new("BlockMesh",Part) | |
380 | Mesh.Scale = Vector3.new(0.1,0.2,0.38) / 0.2 * Scale | |
381 | local PartWeld = Instance.new("Motor6D") | |
382 | PartWeld.Part0 = Handle | |
383 | PartWeld.Part1 = Part | |
384 | PartWeld.C0 = CFrame.new(Vector3.new(0.1,-0.475,0)*Scale) * CFrame.Angles(0,0,0) | |
385 | PartWeld.Parent = Part | |
386 | ||
387 | local Part = Instance.new("Part",Model) | |
388 | Part.CanCollide = false | |
389 | Part.Position = Vector3.new(0,100,0) | |
390 | Part:BreakJoints() | |
391 | Part.FormFactor = "Custom" | |
392 | Part.Size = Vector3.new(0.2,0.2,0.2) | |
393 | Part.TopSurface = "SmoothNoOutlines" | |
394 | Part.BottomSurface = "SmoothNoOutlines" | |
395 | Part.FrontSurface = "SmoothNoOutlines" | |
396 | Part.BackSurface = "SmoothNoOutlines" | |
397 | Part.RightSurface = "SmoothNoOutlines" | |
398 | Part.LeftSurface = "SmoothNoOutlines" | |
399 | Part.BrickColor = BrickColor.new("Black") | |
400 | local Mesh = Instance.new("BlockMesh",Part) | |
401 | Mesh.Scale = Vector3.new(0.1,0.3,0.05) / 0.2 * Scale | |
402 | local PartWeld = Instance.new("Motor6D") | |
403 | PartWeld.Part0 = Handle | |
404 | PartWeld.Part1 = Part | |
405 | PartWeld.C0 = CFrame.Angles(math.rad(15),0,0) * CFrame.new(Vector3.new(0,0.25,-0.75)*Scale) * CFrame.Angles(math.rad(-10),0,0) | |
406 | PartWeld.Parent = Part | |
407 | ||
408 | local Part = Instance.new("Part",Model) | |
409 | Part.CanCollide = false | |
410 | Part.Position = Vector3.new(0,100,0) | |
411 | Part:BreakJoints() | |
412 | Part.FormFactor = "Custom" | |
413 | Part.Size = Vector3.new(0.2,0.2,0.2) | |
414 | Part.TopSurface = "SmoothNoOutlines" | |
415 | Part.BottomSurface = "SmoothNoOutlines" | |
416 | Part.FrontSurface = "SmoothNoOutlines" | |
417 | Part.BackSurface = "SmoothNoOutlines" | |
418 | Part.RightSurface = "SmoothNoOutlines" | |
419 | Part.LeftSurface = "SmoothNoOutlines" | |
420 | Part.BrickColor = BrickColor.new("Black") | |
421 | local Mesh = Instance.new("BlockMesh",Part) | |
422 | Mesh.Scale = Vector3.new(0.1,0.05,0.625) / 0.2 * Scale | |
423 | local PartWeld = Instance.new("Motor6D") | |
424 | PartWeld.Part0 = Handle | |
425 | PartWeld.Part1 = Part | |
426 | PartWeld.C0 = CFrame.Angles(math.rad(15),0,0) * CFrame.new(Vector3.new(0,0.1,-0.435)*Scale) | |
427 | PartWeld.Parent = Part | |
428 | ||
429 | for i = 0,80,10 do | |
430 | local Part = Instance.new("Part",Model) | |
431 | Part.CanCollide = false | |
432 | Part.Position = Vector3.new(0,100,0) | |
433 | Part:BreakJoints() | |
434 | Part.FormFactor = "Custom" | |
435 | Part.Size = Vector3.new(0.2,0.2,0.2) | |
436 | Part.TopSurface = "SmoothNoOutlines" | |
437 | Part.BottomSurface = "SmoothNoOutlines" | |
438 | Part.FrontSurface = "SmoothNoOutlines" | |
439 | Part.BackSurface = "SmoothNoOutlines" | |
440 | Part.RightSurface = "SmoothNoOutlines" | |
441 | Part.LeftSurface = "SmoothNoOutlines" | |
442 | Part.BrickColor = BrickColor.new("Black") | |
443 | local Mesh = Instance.new("BlockMesh",Part) | |
444 | Mesh.Scale = Vector3.new(0.25,0.15,0.03555*2) / 0.2 * Scale | |
445 | local PartWeld = Instance.new("Motor6D") | |
446 | PartWeld.Part0 = Handle | |
447 | PartWeld.Part1 = Part | |
448 | PartWeld.C0 = CFrame.new(Vector3.new(0,0.15,0.315)*Scale) * CFrame.Angles(math.rad(i-65),0,0) * CFrame.new(Vector3.new(0,0.2,0)*Scale) | |
449 | PartWeld.Parent = Part | |
450 | end | |
451 | ||
452 | local Barrel = Instance.new("Part",Model) | |
453 | Barrel.CanCollide = false | |
454 | Barrel.Position = Vector3.new(0,100,0) | |
455 | Barrel:BreakJoints() | |
456 | Barrel.FormFactor = "Custom" | |
457 | Barrel.Size = Vector3.new(0.2,0.2,0.2) | |
458 | Barrel.TopSurface = "SmoothNoOutlines" | |
459 | Barrel.BottomSurface = "SmoothNoOutlines" | |
460 | Barrel.FrontSurface = "SmoothNoOutlines" | |
461 | Barrel.BackSurface = "SmoothNoOutlines" | |
462 | Barrel.RightSurface = "SmoothNoOutlines" | |
463 | Barrel.LeftSurface = "SmoothNoOutlines" | |
464 | Barrel.BrickColor = BrickColor.new("Black") | |
465 | local Mesh = Instance.new("BlockMesh",Barrel) | |
466 | Mesh.Scale = Vector3.new(0.25,0.2,2) / 0.2 * Scale | |
467 | local BarrelWeld = Instance.new("Motor6D") | |
468 | BarrelWeld.Part0 = Handle | |
469 | BarrelWeld.Part1 = Barrel | |
470 | BarrelWeld.C0 = CFrame.Angles(math.rad(15),0,0) * CFrame.new(Vector3.new(0,0.5,-0.7)*Scale) | |
471 | BarrelWeld.Parent = Barrel | |
472 | ||
473 | local Barrel1 = Barrel | |
474 | ||
475 | local Barrel2 = Instance.new("Part",Model) | |
476 | Barrel2.CanCollide = false | |
477 | Barrel2.Position = Vector3.new(0,100,0) | |
478 | Barrel2:BreakJoints() | |
479 | Barrel2.FormFactor = "Custom" | |
480 | Barrel2.Size = Vector3.new(0.2,0.2,0.2) | |
481 | Barrel2.TopSurface = "SmoothNoOutlines" | |
482 | Barrel2.BottomSurface = "SmoothNoOutlines" | |
483 | Barrel2.FrontSurface = "SmoothNoOutlines" | |
484 | Barrel2.BackSurface = "SmoothNoOutlines" | |
485 | Barrel2.RightSurface = "SmoothNoOutlines" | |
486 | Barrel2.LeftSurface = "SmoothNoOutlines" | |
487 | Barrel2.BrickColor = BrickColor.new("Really black") | |
488 | local Mesh = Instance.new("BlockMesh",Barrel2) | |
489 | Mesh.Scale = Vector3.new(0.25,0.25,2) / 0.2 * Scale | |
490 | local Barrel2Weld = Instance.new("Motor6D") | |
491 | Barrel2Weld.Part0 = Barrel | |
492 | Barrel2Weld.Part1 = Barrel2 | |
493 | Barrel2Weld.C0 = CFrame.new(Vector3.new(0,0.225,0)*Scale) | |
494 | Barrel2Weld.Parent = Barrel2 | |
495 | ||
496 | local RealBarrel = Instance.new("Part",Model) | |
497 | RealBarrel.CanCollide = false | |
498 | RealBarrel.Position = Vector3.new(0,100,0) | |
499 | RealBarrel:BreakJoints() | |
500 | RealBarrel.FormFactor = "Custom" | |
501 | RealBarrel.Size = Vector3.new(0.2,0.2,0.2) | |
502 | RealBarrel.TopSurface = "SmoothNoOutlines" | |
503 | RealBarrel.BottomSurface = "SmoothNoOutlines" | |
504 | RealBarrel.FrontSurface = "SmoothNoOutlines" | |
505 | RealBarrel.BackSurface = "SmoothNoOutlines" | |
506 | RealBarrel.RightSurface = "SmoothNoOutlines" | |
507 | RealBarrel.LeftSurface = "SmoothNoOutlines" | |
508 | RealBarrel.BrickColor = BrickColor.new("Dark grey metallic") | |
509 | local Mesh = Instance.new("CylinderMesh",RealBarrel) | |
510 | Mesh.Scale = Vector3.new(0.2,2,0.2) / 0.2 * Scale | |
511 | local RealBarrelWeld = Instance.new("Motor6D") | |
512 | RealBarrelWeld.Part0 = Barrel | |
513 | RealBarrelWeld.Part1 = RealBarrel | |
514 | RealBarrelWeld.C0 = CFrame.new(Vector3.new(0,0.1,-0.01)*Scale) * CFrame.Angles(math.rad(-90),0,0) | |
515 | RealBarrelWeld.Parent = RealBarrel | |
516 | ||
517 | for i = 1,75,15 do | |
518 | local Part = Instance.new("Part",Model) | |
519 | Part.CanCollide = false | |
520 | Part.Position = Vector3.new(0,100,0) | |
521 | Part:BreakJoints() | |
522 | Part.FormFactor = "Custom" | |
523 | Part.Size = Vector3.new(0.2,0.2,0.2) | |
524 | Part.TopSurface = "SmoothNoOutlines" | |
525 | Part.BottomSurface = "SmoothNoOutlines" | |
526 | Part.FrontSurface = "SmoothNoOutlines" | |
527 | Part.BackSurface = "SmoothNoOutlines" | |
528 | Part.RightSurface = "SmoothNoOutlines" | |
529 | Part.LeftSurface = "SmoothNoOutlines" | |
530 | Part.BrickColor = BrickColor.new("Black") | |
531 | local Mesh = Instance.new("BlockMesh",Part) | |
532 | Mesh.Scale = Vector3.new(0.05,0.065,0.05) / 0.2 * Scale | |
533 | local PartWeld = Instance.new("Motor6D") | |
534 | PartWeld.Part0 = Handle | |
535 | PartWeld.Part1 = Part | |
536 | 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) | |
537 | PartWeld.Parent = Part | |
538 | end | |
539 | ||
540 | local Part = Instance.new("Part",Model) | |
541 | Part.CanCollide = false | |
542 | Part.Position = Vector3.new(0,100,0) | |
543 | Part:BreakJoints() | |
544 | Part.FormFactor = "Custom" | |
545 | Part.Size = Vector3.new(0.2,0.2,0.2) | |
546 | Part.TopSurface = "SmoothNoOutlines" | |
547 | Part.BottomSurface = "SmoothNoOutlines" | |
548 | Part.FrontSurface = "SmoothNoOutlines" | |
549 | Part.BackSurface = "SmoothNoOutlines" | |
550 | Part.RightSurface = "SmoothNoOutlines" | |
551 | Part.LeftSurface = "SmoothNoOutlines" | |
552 | Part.BrickColor = BrickColor.new("Really black") | |
553 | local Mesh = Instance.new("BlockMesh",Part) | |
554 | Mesh.Scale = Vector3.new(0.05,0.11,0.1) / 0.2 * Scale | |
555 | local PartWeld = Instance.new("Motor6D") | |
556 | PartWeld.Part0 = Barrel2 | |
557 | PartWeld.Part1 = Part | |
558 | PartWeld.C0 = CFrame.new(Vector3.new(0.06,0.135,0.925)*Scale) | |
559 | PartWeld.Parent = Part | |
560 | ||
561 | local Part = Instance.new("Part",Model) | |
562 | Part.CanCollide = false | |
563 | Part.Position = Vector3.new(0,100,0) | |
564 | Part:BreakJoints() | |
565 | Part.FormFactor = "Custom" | |
566 | Part.Size = Vector3.new(0.2,0.2,0.2) | |
567 | Part.TopSurface = "SmoothNoOutlines" | |
568 | Part.BottomSurface = "SmoothNoOutlines" | |
569 | Part.FrontSurface = "SmoothNoOutlines" | |
570 | Part.BackSurface = "SmoothNoOutlines" | |
571 | Part.RightSurface = "SmoothNoOutlines" | |
572 | Part.LeftSurface = "SmoothNoOutlines" | |
573 | Part.BrickColor = BrickColor.new("Really black") | |
574 | local Mesh = Instance.new("BlockMesh",Part) | |
575 | Mesh.Scale = Vector3.new(0.05,0.11,0.1) / 0.2 * Scale | |
576 | local PartWeld = Instance.new("Motor6D") | |
577 | PartWeld.Part0 = Barrel2 | |
578 | PartWeld.Part1 = Part | |
579 | PartWeld.C0 = CFrame.new(Vector3.new(-0.06,0.135,0.925)*Scale) | |
580 | PartWeld.Parent = Part | |
581 | ||
582 | local Part = Instance.new("Part",Model) | |
583 | Part.CanCollide = false | |
584 | Part.Position = Vector3.new(0,100,0) | |
585 | Part:BreakJoints() | |
586 | Part.FormFactor = "Custom" | |
587 | Part.Size = Vector3.new(0.2,0.2,0.2) | |
588 | Part.TopSurface = "SmoothNoOutlines" | |
589 | Part.BottomSurface = "SmoothNoOutlines" | |
590 | Part.FrontSurface = "SmoothNoOutlines" | |
591 | Part.BackSurface = "SmoothNoOutlines" | |
592 | Part.RightSurface = "SmoothNoOutlines" | |
593 | Part.LeftSurface = "SmoothNoOutlines" | |
594 | Part.BrickColor = BrickColor.new("Really black") | |
595 | local Mesh = Instance.new("BlockMesh",Part) | |
596 | Mesh.Scale = Vector3.new(0.025,0.1,0.1) / 0.2 * Scale | |
597 | local PartWeld = Instance.new("Motor6D") | |
598 | PartWeld.Part0 = Barrel2 | |
599 | PartWeld.Part1 = Part | |
600 | PartWeld.C0 = CFrame.new(Vector3.new(0,0.135,-0.925)*Scale) | |
601 | PartWeld.Parent = Part | |
602 | ||
603 | local Part = Instance.new("Part",Model) | |
604 | Part.CanCollide = false | |
605 | Part.Position = Vector3.new(0,100,0) | |
606 | Part:BreakJoints() | |
607 | Part.FormFactor = "Custom" | |
608 | Part.Size = Vector3.new(0.2,0.2,0.2) | |
609 | Part.Transparency = 1 | |
610 | Part.TopSurface = "SmoothNoOutlines" | |
611 | Part.BottomSurface = "SmoothNoOutlines" | |
612 | Part.FrontSurface = "SmoothNoOutlines" | |
613 | Part.BackSurface = "SmoothNoOutlines" | |
614 | Part.RightSurface = "SmoothNoOutlines" | |
615 | Part.LeftSurface = "SmoothNoOutlines" | |
616 | Part.BrickColor = BrickColor.new("Really black") | |
617 | local Mesh = Instance.new("BlockMesh",Part) | |
618 | Mesh.Scale = Vector3.new(0.1,0.1,0.1) / 0.2 * Scale | |
619 | local PartWeld = Instance.new("Motor6D") | |
620 | PartWeld.Part0 = Barrel | |
621 | PartWeld.Part1 = Part | |
622 | PartWeld.C0 = CFrame.new(Vector3.new(0,0,-5)*Scale) | |
623 | PartWeld.Parent = Part | |
624 | ||
625 | local Light = Instance.new("PointLight",Part) | |
626 | Light.Color = BrickColor.new("Gold").Color | |
627 | Light.Enabled = true | |
628 | Light.Shadows = true | |
629 | Light.Brightness = 0 | |
630 | Light.Range = 6 | |
631 | ||
632 | local Part = Instance.new("Part",Model) | |
633 | Part.Material = "Neon" | |
634 | Part.CanCollide = false | |
635 | Part.Position = Vector3.new(0,100,0) | |
636 | Part:BreakJoints() | |
637 | Part.FormFactor = "Custom" | |
638 | Part.Size = Vector3.new(0.2,0.2,0.2) | |
639 | Part.TopSurface = "SmoothNoOutlines" | |
640 | Part.BottomSurface = "SmoothNoOutlines" | |
641 | Part.FrontSurface = "SmoothNoOutlines" | |
642 | Part.BackSurface = "SmoothNoOutlines" | |
643 | Part.RightSurface = "SmoothNoOutlines" | |
644 | Part.LeftSurface = "SmoothNoOutlines" | |
645 | Part.BrickColor = BrickColor.new("Bright yellow") | |
646 | Part.Transparency = 0.25 | |
647 | local RecoilMesh = Instance.new("SpecialMesh",Part) | |
648 | RecoilMesh.MeshType = "FileMesh" | |
649 | RecoilMesh.MeshId = "http://www.roblox.com/Asset/?id=1323306" | |
650 | RecoilMesh.TextureId = "http://www.roblox.com/Asset/?id=98896228" | |
651 | RecoilMesh.Scale = Vector3.new(0.175,0,0.175) * Scale | |
652 | local PartWeld = Instance.new("Motor6D") | |
653 | PartWeld.Part0 = RealBarrel | |
654 | PartWeld.Part1 = Part | |
655 | PartWeld.C0 = CFrame.new(Vector3.new(0,0.95,0)*Scale) | |
656 | PartWeld.Parent = Part | |
657 | ||
658 | function ShootBullet(Target,barrel) | |
659 | local barrel = barrel or Barrel | |
660 | local Bullet = Instance.new("Part",Workspace) | |
661 | Barrel.CanCollide = false | |
662 | Bullet.FormFactor = "Custom" | |
663 | Bullet.Size = Vector3.new(0.2,0.2,5)*Scale | |
664 | Bullet.TopSurface = "Smooth" | |
665 | Bullet.BottomSurface = "Smooth" | |
666 | Bullet.Anchored = true | |
667 | Bullet.CanCollide = false | |
668 | 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) | |
669 | Bullet.Transparency = 0.1 | |
670 | Bullet.BrickColor = BrickColor.new("Gold") | |
671 | --[[local Mesh = Instance.new("SpecialMesh",Bullet) | |
672 | Mesh.MeshType = "FileMesh" | |
673 | Mesh.Scale = Vector3.new(0.5,0.5,0.2) | |
674 | Mesh.MeshId = "http://www.roblox.com/asset/?id=2697549" | |
675 | --Mesh.TextureId = "http://www.roblox.com/asset/?id=2697544"]] | |
676 | local Mesh = Instance.new("BlockMesh",Bullet) | |
677 | Mesh.Scale = Vector3.new(0.2,0.2,5)*Scale/Bullet.Size | |
678 | IgnoreList[#IgnoreList+1] = Bullet | |
679 | RenderStepped:wait() | |
680 | for i = Speed,1000,Speed do -- Loop to do the bullet movement and stuff. | |
681 | local ray,Hit,Pos,SurfaceNormal; | |
682 | ray = Ray.new(Bullet.Position,((Bullet.CFrame*CFrame.Angles(math.rad(-Gravity),0,0)*CFrame.new(0,0,-Speed)).p-Bullet.Position).unit*Speed) | |
683 | Hit,Pos,SurfaceNormal = Workspace:FindPartOnRayWithIgnoreList(ray,IgnoreList) | |
684 | Bullet.CFrame = Bullet.CFrame*CFrame.Angles(math.rad(-Gravity),0,0)*CFrame.new(0,0,-Speed) | |
685 | if Hit ~= nil then | |
686 | local Hum = Hit.Parent:FindFirstChild("Humanoid") or Hit.Parent.Parent:FindFirstChild("Humanoid") or (Hit.Parent.Parent.Parent ~= nil and Hit.Parent.Parent.Parent:FindFirstChild("Humanoid")) | |
687 | if Hum ~= nil then | |
688 | Hum:TakeDamage((((Gangster and math.random(99999,99999) or math.random(99999,99999))*Scale)/100)*Hum.MaxHealth) | |
689 | end | |
690 | break | |
691 | end | |
692 | RenderStepped:wait() | |
693 | end | |
694 | Bullet:Destroy() | |
695 | end | |
696 | ||
697 | Mouse.Button1Down:connect(function() | |
698 | if not Down and not DB then | |
699 | Down = true | |
700 | while Down do | |
701 | if Humanoid.Health == 0 then break end | |
702 | if not DB then | |
703 | DB = true | |
704 | local Sound = Instance.new("Sound",Barrel) | |
705 | Sound.SoundId = "http://www.roblox.com/Asset/?id=165946426" -- 132373574 | |
706 | Sound.Volume = 5*Scale | |
707 | Sound.Pitch = (math.random(70,110)/100)/((Scale < 0.25 and 0.25) or (Scale > 4 and 4) or Scale) | |
708 | Sound:Play() | |
709 | Spawn(function() | |
710 | ShootBullet(Mouse.Hit.p,Barrel1) | |
711 | end) | |
712 | RecoilMesh.VertexColor = Vector3.new(1,math.random(160,245)/255,20/255) | |
713 | PartWeld.C0 = PartWeld.C0 * CFrame.Angles(0,math.rad(math.random(-40,40)),0) | |
714 | local Shell = Instance.new("Part",Workspace) | |
715 | Shell.FormFactor = "Custom" | |
716 | Shell.BrickColor = BrickColor.new("Bright yellow") | |
717 | Shell.Size = Vector3.new(0.2,0.5,0.2)*Scale | |
718 | Shell.CFrame = Barrel.CFrame*CFrame.new(0.5,0.5,0)*CFrame.Angles(math.rad(-90),0,0) | |
719 | Shell.Velocity = ((Barrel.CFrame*CFrame.new(5,0,math.random(-2,2))).p-Barrel.CFrame.p)*5*Scale | |
720 | local Mesh = Instance.new("CylinderMesh",Shell) | |
721 | Mesh.Scale = Vector3.new(0.2,0.5,0.2)*Scale/Shell.Size | |
722 | Spawn(function() | |
723 | wait(5) | |
724 | Shell:Destroy() | |
725 | end) | |
726 | for i = 1,20,7.5 do | |
727 | RotationOffset = RotationOffset*CFrame.Angles(math.rad(7.5),0,0) | |
728 | Part1Joint = Part1Joint*CFrame.new(Vector3.new(0,-0.15,0)*Scale) | |
729 | Barrel2Weld.C0 = Barrel2Weld.C0*CFrame.new(Vector3.new(0,0,0.15)*Scale) | |
730 | Light.Brightness = Light.Brightness+38 | |
731 | RecoilMesh.Scale = RecoilMesh.Scale+(Vector3.new(0,0.375,0)*Scale) | |
732 | RenderStepped:wait() | |
733 | end | |
734 | wait(0.02) | |
735 | for i = 1,20,3.75 do | |
736 | RotationOffset = RotationOffset*CFrame.Angles(math.rad(-3.75),0,0) | |
737 | Part1Joint = Part1Joint*CFrame.new(Vector3.new(0,0.075,0)*Scale) | |
738 | Barrel2Weld.C0 = Barrel2Weld.C0*CFrame.new(Vector3.new(0,0,-0.075)*Scale) | |
739 | Light.Brightness = Light.Brightness-19 | |
740 | RecoilMesh.Scale = RecoilMesh.Scale+(Vector3.new(0,-0.1875,0)*Scale) | |
741 | RenderStepped:wait() | |
742 | end | |
743 | wait() | |
744 | DB = false | |
745 | end | |
746 | end | |
747 | end | |
748 | end) | |
749 | ||
750 | Mouse.Button1Up:connect(function() | |
751 | Down = false | |
752 | end) | |
753 | ||
754 | Mouse.KeyDown:connect(function(Key) | |
755 | if Key:lower() == "g" and not DB then | |
756 | DB = true | |
757 | if Gangster == true then | |
758 | for i = 1,70,5 do | |
759 | RotationOffset = RotationOffset*CFrame.Angles(0,math.rad(-5),0) | |
760 | RenderStepped:wait() | |
761 | end | |
762 | Gangster = false | |
763 | else | |
764 | for i = 1,70,5 do | |
765 | RotationOffset = RotationOffset*CFrame.Angles(0,math.rad(5),0) | |
766 | RenderStepped:wait() | |
767 | end | |
768 | Gangster = true | |
769 | end | |
770 | DB = false | |
771 | end | |
772 | end) | |
773 | ||
774 | local Weld = Instance.new("Weld") | |
775 | Weld.Part0 = Torso | |
776 | Weld.Part1 = Character["Right Arm"] | |
777 | Weld.Parent = Torso | |
778 | ||
779 | local Weld2 = Instance.new("Weld") | |
780 | Weld2.Part0 = Torso | |
781 | Weld2.Part1 = Character.Head | |
782 | Weld2.Parent = Torso | |
783 | ||
784 | local RA = Character["Right Arm"] | |
785 | ||
786 | game:GetService("RunService"):BindToRenderStep("Pistol",Enum.RenderPriority.Character.Value,function() | |
787 | local Point = Torso.CFrame:vectorToObjectSpace(Mouse.Hit.p-Torso.CFrame.p) | |
788 | if Point.Z > 0 then | |
789 | if Point.X > 0 then | |
790 | Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(Mouse.Hit.X,Torso.Position.Y,Mouse.Hit.Z))*CFrame.Angles(0,math.rad(90),0) | |
791 | elseif Point.X < 0 then | |
792 | Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(Mouse.Hit.X,Torso.Position.Y,Mouse.Hit.Z))*CFrame.Angles(0,math.rad(-90),0) | |
793 | end | |
794 | end | |
795 | ||
796 | local CFr = (Torso.CFrame*Part0Joint):toObjectSpace(CFrame.new((Torso.CFrame*Part0Joint).p,Mouse.Hit.p))--RayEnd)) | |
797 | Weld.C0 = Part0Joint * (CFr-CFr.p) * RotationOffset | |
798 | Weld.C1 = Part1Joint | |
799 | Weld.Part0 = Torso | |
800 | Weld.Part1 = RA | |
801 | local CFr = (Torso.CFrame*Part0JointHead):toObjectSpace(CFrame.new((Torso.CFrame*Part0JointHead).p,Mouse.Hit.p))--RayEnd)) | |
802 | Weld2.C0 = Part0JointHead * (CFr-CFr.p) * RotationOffsetHead | |
803 | Weld2.C1 = Part1JointHead | |
804 | Weld2.Part0 = Torso | |
805 | Weld2.Part1 = Character.Head | |
806 | local Last = Scale | |
807 | Scale = game.Players.LocalPlayer.Character.Torso.Size.X/2*(game.Players.LocalPlayer.Character.Torso:FindFirstChild("ScaleInserted") ~= nil and game.Players.LocalPlayer.Character.Torso:FindFirstChild("ScaleInserted").Scale.Z or 1)*0.8 | |
808 | Speed = 20*Scale | |
809 | if Scale ~= Last then | |
810 | Part0Joint = CFrame.new(Vector3.new(1,0.75,0)*Scale*1.25) | |
811 | Part1Joint = CFrame.new(Vector3.new(-0.5,0.75,0)*Scale*1.25) | |
812 | Part0JointHead = CFrame.new(Vector3.new(0,1,0)*Scale*1.25) | |
813 | Part1JointHead = CFrame.new(Vector3.new(0,-0.5,0)*Scale*1.25) | |
814 | end | |
815 | end) |