View difference between Paste ID: 8M7MXEts and 902mRsuw
SHOW: | | - or go back to the newest paste.
1
-- This script has convert to FE by who i don't know?
2
3
-----------------------------------------------------
4
if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
5
local Player,game,owner = owner,game
6
local RealPlayer = Player
7
do
8
    print("FE Compatibility code by Mokiros | Showcase by Bacon Hair!")
9
    local rp = RealPlayer
10
    script.Parent = rp.Character
11
   
12
    --RemoteEvent for communicating
13
    local Event = Instance.new("RemoteEvent")
14
    Event.Name = "UserInput_Event"
15
 
16
    --Fake event to make stuff like Mouse.KeyDown work
17
    local function fakeEvent()
18
        local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
19
        t.connect = t.Connect
20
        return t
21
    end
22
 
23
    --Creating fake input objects with fake variables
24
    local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
25
    local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
26
    local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
27
        CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
28
    end}
29
    --Merged 2 functions into one by checking amount of arguments
30
    CAS.UnbindAction = CAS.BindAction
31
 
32
    --This function will trigger the events that have been :Connect()'ed
33
    local function te(self,ev,...)
34
        local t = m[ev]
35
        if t and t._fakeEvent then
36
            for _,f in pairs(t.Functions) do
37
                f(...)
38
            end
39
        end
40
    end
41
    m.TrigEvent = te
42
    UIS.TrigEvent = te
43
 
44
    Event.OnServerEvent:Connect(function(plr,io)
45
        if plr~=rp then return end
46
        m.Target = io.Target
47
        m.Hit = io.Hit
48
        if not io.isMouse then
49
            local b = io.UserInputState == Enum.UserInputState.Begin
50
            if io.UserInputType == Enum.UserInputType.MouseButton1 then
51
                return m:TrigEvent(b and "Button1Down" or "Button1Up")
52
            end
53
            for _,t in pairs(CAS.Actions) do
54
                for _,k in pairs(t.Keys) do
55
                    if k==io.KeyCode then
56
                        t.Function(t.Name,io.UserInputState,io)
57
                    end
58
                end
59
            end
60
            m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
61
            UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
62
        end
63
    end)
64
    Event.Parent = NLS([==[
65
    local Player = game:GetService("Players").LocalPlayer
66
    local Event = script:WaitForChild("UserInput_Event")
67
 
68
    local Mouse = Player:GetMouse()
69
    local UIS = game:GetService("UserInputService")
70
    local input = function(io,a)
71
        if a then return end
72
        --Since InputObject is a client-side instance, we create and pass table instead
73
        Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
74
    end
75
    UIS.InputBegan:Connect(input)
76
    UIS.InputEnded:Connect(input)
77
 
78
    local h,t
79
    --Give the server mouse data 30 times every second, but only if the values changed
80
    --If player is not moving their mouse, client won't fire events
81
    while wait(1/30) do
82
        if h~=Mouse.Hit or t~=Mouse.Target then
83
            h,t=Mouse.Hit,Mouse.Target
84
            Event:FireServer({isMouse=true,Target=t,Hit=h})
85
        end
86
    end]==],Player.Character)
87
 
88
    ----Sandboxed game object that allows the usage of client-side methods and services
89
    --Real game object
90
    local _rg = game
91
 
92
    --Metatable for fake service
93
    local fsmt = {
94
        __index = function(self,k)
95
            local s = rawget(self,"_RealService")
96
            if s then return s[k] end
97
        end,
98
        __newindex = function(self,k,v)
99
            local s = rawget(self,"_RealService")
100
            if s then s[k]=v end
101
        end,
102
        __call = function(self,...)
103
            local s = rawget(self,"_RealService")
104
            if s then return s(...) end
105
        end
106
    }
107
    local function FakeService(t,RealService)
108
        t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
109
        return setmetatable(t,fsmt)
110
    end
111
 
112
    --Fake game object
113
    local g = {
114
        GetService = function(self,s)
115
            return self[s]
116
        end,
117
        Players = FakeService({
118
            LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
119
        },"Players"),
120
        UserInputService = FakeService(UIS,"UserInputService"),
121
        ContextActionService = FakeService(CAS,"ContextActionService"),
122
    }
123
    rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
124
    g.service = g.GetService
125
   
126
    g.RunService = FakeService({
127
        RenderStepped = _rg:GetService("RunService").Heartbeat,
128
        BindToRenderStep = function(self,name,_,fun)
129
 
130
        end,
131
        UnbindFromRenderStep = function(self,name)
132
            self._btrs[name]:Disconnect()
133
        end,
134
    },"RunService")
135
 
136
    setmetatable(g,{
137
        __index=function(self,s)
138
            return _rg:GetService(s) or typeof(_rg[s])=="function"
139
            and function(_,...)return _rg[s](_rg,...)end or _rg[s]
140
        end,
141
        __newindex = fsmt.__newindex,
142
        __call = fsmt.__call
143
    })
144
    --Changing owner to fake player object to support owner:GetMouse()
145
    game,owner = g,g.Players.LocalPlayer
146
end
147
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 1)*0.8
148
local Speed = 20*Scale
149
local Gravity = 0.1
150
151
local Player = game.Players.LocalPlayer
152
local Character = Player.Character
153
local Humanoid = Character.Humanoid
154
Humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll,false)
155
local Torso = Character.HumanoidRootPart
156
local Mouse = game.Players.LocalPlayer:GetMouse()
157
local RenderStepped = game:GetService("RunService").RenderStepped
158
local Camera = Workspace.CurrentCamera
159
Camera:ClearAllChildren()
160
local Model = Instance.new("Model",Character)
161
local IgnoreList = {Character,Workspace.Terrain}
162
163
local Part0Joint = CFrame.new(Vector3.new(1,0.75,0)*Scale*1.25)
164
local Part1Joint = CFrame.new(Vector3.new(-0.5,0.75,0)*Scale*1.25)
165
local RotationOffset = CFrame.Angles(math.rad(90),math.rad(0),0)
166
local Gangster = false
167
168
local Part0JointHead = CFrame.new(Vector3.new(0,1,0)*Scale*1.25)
169
local Part1JointHead = CFrame.new(Vector3.new(0,-0.5,0)*Scale*1.25)
170
local RotationOffsetHead = CFrame.Angles(0,0,0)
171
172
local Handle = Instance.new("Part",Model)
173
Handle.CanCollide = false
174
Handle.Name = "Handle"
175
Handle.Position = Vector3.new(0,100,0)
176
Handle:BreakJoints()
177
Handle.FormFactor = "Custom"
178
Handle.Size = Vector3.new(0.2,0.2,0.2)
179
Handle.TopSurface = "SmoothNoOutlines"
180
Handle.BottomSurface = "SmoothNoOutlines"
181
Handle.FrontSurface = "SmoothNoOutlines"
182
Handle.BackSurface = "SmoothNoOutlines"
183
Handle.RightSurface = "SmoothNoOutlines"
184
Handle.LeftSurface = "SmoothNoOutlines"
185
Handle.BrickColor = BrickColor.new("Black")
186
local Mesh = Instance.new("BlockMesh",Handle)
187
Mesh.Scale = Vector3.new(0.25,1,0.4) / 0.2 * Scale
188
local HandleWeld = Instance.new("Motor6D")
189
HandleWeld.Part0 = Character["Right Arm"]
190
HandleWeld.Part1 = Handle
191
HandleWeld.C0 = CFrame.new(Vector3.new(0,-1,0)*Scale) * CFrame.Angles(math.rad(-105),0,0)
192
HandleWeld.Parent = Handle
193
194
local Part = Instance.new("Part",Model)
195
Part.CanCollide = false
196
Part.Position = Vector3.new(0,100,0)
197
Part:BreakJoints()
198
Part.FormFactor = "Custom"
199
Part.Size = Vector3.new(0.2,0.2,0.2)
200
Part.TopSurface = "SmoothNoOutlines"
201
Part.BottomSurface = "SmoothNoOutlines"
202
Part.FrontSurface = "SmoothNoOutlines"
203
Part.BackSurface = "SmoothNoOutlines"
204
Part.RightSurface = "SmoothNoOutlines"
205
Part.LeftSurface = "SmoothNoOutlines"
206
Part.BrickColor = BrickColor.new("Black")
207
local Mesh = Instance.new("CylinderMesh",Part)
208
Mesh.Scale = Vector3.new(0.07,0.2,0.07) / 0.2 * Scale
209
local PartWeld = Instance.new("Motor6D")
210
PartWeld.Part0 = Handle
211
PartWeld.Part1 = Part
212
PartWeld.C0 = CFrame.new(Vector3.new(-0.115,-0.475,-0.190)*Scale) * CFrame.Angles(0,0,0)
213
PartWeld.Parent = Part
214
215
local Part = Instance.new("Part",Model)
216
Part.CanCollide = false
217
Part.Position = Vector3.new(0,100,0)
218
Part:BreakJoints()
219
Part.FormFactor = "Custom"
220
Part.Size = Vector3.new(0.2,0.2,0.2)
221
Part.TopSurface = "SmoothNoOutlines"
222
Part.BottomSurface = "SmoothNoOutlines"
223
Part.FrontSurface = "SmoothNoOutlines"
224
Part.BackSurface = "SmoothNoOutlines"
225
Part.RightSurface = "SmoothNoOutlines"
226
Part.LeftSurface = "SmoothNoOutlines"
227
Part.BrickColor = BrickColor.new("Black")
228
local Mesh = Instance.new("CylinderMesh",Part)
229
Mesh.Scale = Vector3.new(0.07,0.2,0.07) / 0.2 * Scale
230
local PartWeld = Instance.new("Motor6D")
231
PartWeld.Part0 = Handle
232
PartWeld.Part1 = Part
233
PartWeld.C0 = CFrame.new(Vector3.new(0.115,-0.475,0.190)*Scale) * CFrame.Angles(0,0,0) 
234
PartWeld.Parent = Part
235
236
local Part = Instance.new("Part",Model)
237
Part.CanCollide = false
238
Part.Position = Vector3.new(0,100,0)
239
Part:BreakJoints()
240
Part.FormFactor = "Custom"
241
Part.Size = Vector3.new(0.2,0.2,0.2)
242
Part.TopSurface = "SmoothNoOutlines"
243
Part.BottomSurface = "SmoothNoOutlines"
244
Part.FrontSurface = "SmoothNoOutlines"
245
Part.BackSurface = "SmoothNoOutlines"
246
Part.RightSurface = "SmoothNoOutlines"
247
Part.LeftSurface = "SmoothNoOutlines"
248
Part.BrickColor = BrickColor.new("Black")
249
local Mesh = Instance.new("CylinderMesh",Part)
250
Mesh.Scale = Vector3.new(0.07,0.2,0.07) / 0.2 * Scale
251
local PartWeld = Instance.new("Motor6D")
252
PartWeld.Part0 = Handle
253
PartWeld.Part1 = Part
254
PartWeld.C0 = CFrame.new(Vector3.new(-0.115,-0.475,0.190)*Scale) * CFrame.Angles(0,0,0)
255
PartWeld.Parent = Part
256
257
local Part = Instance.new("Part",Model)
258
Part.CanCollide = false
259
Part.Position = Vector3.new(0,100,0)
260
Part:BreakJoints()
261
Part.FormFactor = "Custom"
262
Part.Size = Vector3.new(0.2,0.2,0.2)
263
Part.TopSurface = "SmoothNoOutlines"
264
Part.BottomSurface = "SmoothNoOutlines"
265
Part.FrontSurface = "SmoothNoOutlines"
266
Part.BackSurface = "SmoothNoOutlines"
267
Part.RightSurface = "SmoothNoOutlines"
268
Part.LeftSurface = "SmoothNoOutlines"
269
Part.BrickColor = BrickColor.new("Black")
270
local Mesh = Instance.new("CylinderMesh",Part)
271
Mesh.Scale = Vector3.new(0.07,0.2,0.07) / 0.2 * Scale
272
local PartWeld = Instance.new("Motor6D")
273
PartWeld.Part0 = Handle
274
PartWeld.Part1 = Part
275
PartWeld.C0 = CFrame.new(Vector3.new(0.115,-0.475,-0.190)*Scale) * CFrame.Angles(0,0,0)
276
PartWeld.Parent = Part
277
278
local Part = Instance.new("Part",Model)
279
Part.CanCollide = false
280
Part.Position = Vector3.new(0,100,0)
281
Part:BreakJoints()
282
Part.FormFactor = "Custom"
283
Part.Size = Vector3.new(0.2,0.2,0.2)
284
Part.TopSurface = "SmoothNoOutlines"
285
Part.BottomSurface = "SmoothNoOutlines"
286
Part.FrontSurface = "SmoothNoOutlines"
287
Part.BackSurface = "SmoothNoOutlines"
288
Part.RightSurface = "SmoothNoOutlines"
289
Part.LeftSurface = "SmoothNoOutlines"
290
Part.BrickColor = BrickColor.new("Black")
291
local Mesh = Instance.new("BlockMesh",Part)
292
Mesh.Scale = Vector3.new(0.23,0.2,0.1) / 0.2 * Scale
293
local PartWeld = Instance.new("Motor6D")
294
PartWeld.Part0 = Handle
295
PartWeld.Part1 = Part
296
PartWeld.C0 = CFrame.new(Vector3.new(0,-0.475,-0.175)*Scale) * CFrame.Angles(0,0,0)
297
PartWeld.Parent = Part
298
299
local Part = Instance.new("Part",Model)
300
Part.CanCollide = false
301
Part.Position = Vector3.new(0,100,0)
302
Part:BreakJoints()
303
Part.FormFactor = "Custom"
304
Part.Size = Vector3.new(0.2,0.2,0.2)
305
Part.TopSurface = "SmoothNoOutlines"
306
Part.BottomSurface = "SmoothNoOutlines"
307
Part.FrontSurface = "SmoothNoOutlines"
308
Part.BackSurface = "SmoothNoOutlines"
309
Part.RightSurface = "SmoothNoOutlines"
310
Part.LeftSurface = "SmoothNoOutlines"
311
Part.BrickColor = BrickColor.new("Black")
312
local Mesh = Instance.new("BlockMesh",Part)
313
Mesh.Scale = Vector3.new(0.23,0.2,0.1) / 0.2 * Scale
314
local PartWeld = Instance.new("Motor6D")
315
PartWeld.Part0 = Handle
316
PartWeld.Part1 = Part
317
PartWeld.C0 = CFrame.new(Vector3.new(0,-0.475,0.175)*Scale) * CFrame.Angles(0,0,0)
318
PartWeld.Parent = Part
319
320
local Part = Instance.new("Part",Model)
321
Part.CanCollide = false
322
Part.Position = Vector3.new(0,100,0)
323
Part:BreakJoints()
324
Part.FormFactor = "Custom"
325
Part.Size = Vector3.new(0.2,0.2,0.2)
326
Part.TopSurface = "SmoothNoOutlines"
327
Part.BottomSurface = "SmoothNoOutlines"
328
Part.FrontSurface = "SmoothNoOutlines"
329
Part.BackSurface = "SmoothNoOutlines"
330
Part.RightSurface = "SmoothNoOutlines"
331
Part.LeftSurface = "SmoothNoOutlines"
332
Part.BrickColor = BrickColor.new("Black")
333
local Mesh = Instance.new("BlockMesh",Part)
334
Mesh.Scale = Vector3.new(0.1,0.2,0.38) / 0.2 * Scale
335
local PartWeld = Instance.new("Motor6D")
336
PartWeld.Part0 = Handle
337
PartWeld.Part1 = Part
338
PartWeld.C0 = CFrame.new(Vector3.new(-0.1,-0.475,0)*Scale) * CFrame.Angles(0,0,0)
339
PartWeld.Parent = Part
340
341
local Part = Instance.new("Part",Model)
342
Part.CanCollide = false
343
Part.Position = Vector3.new(0,100,0)
344
Part:BreakJoints()
345
Part.FormFactor = "Custom"
346
Part.Size = Vector3.new(0.2,0.2,0.2)
347
Part.TopSurface = "SmoothNoOutlines"
348
Part.BottomSurface = "SmoothNoOutlines"
349
Part.FrontSurface = "SmoothNoOutlines"
350
Part.BackSurface = "SmoothNoOutlines"
351
Part.RightSurface = "SmoothNoOutlines"
352
Part.LeftSurface = "SmoothNoOutlines"
353
Part.BrickColor = BrickColor.new("Black")
354
local Mesh = Instance.new("BlockMesh",Part)
355
Mesh.Scale = Vector3.new(0.1,0.2,0.38) / 0.2 * Scale
356
local PartWeld = Instance.new("Motor6D")
357
PartWeld.Part0 = Handle
358
PartWeld.Part1 = Part
359
PartWeld.C0 = CFrame.new(Vector3.new(0.1,-0.475,0)*Scale) * CFrame.Angles(0,0,0)
360
PartWeld.Parent = Part
361
362
local Part = Instance.new("Part",Model)
363
Part.CanCollide = false
364
Part.Position = Vector3.new(0,100,0)
365
Part:BreakJoints()
366
Part.FormFactor = "Custom"
367
Part.Size = Vector3.new(0.2,0.2,0.2)
368
Part.TopSurface = "SmoothNoOutlines"
369
Part.BottomSurface = "SmoothNoOutlines"
370
Part.FrontSurface = "SmoothNoOutlines"
371
Part.BackSurface = "SmoothNoOutlines"
372
Part.RightSurface = "SmoothNoOutlines"
373
Part.LeftSurface = "SmoothNoOutlines"
374
Part.BrickColor = BrickColor.new("Black")
375
local Mesh = Instance.new("BlockMesh",Part)
376
Mesh.Scale = Vector3.new(0.1,0.3,0.05) / 0.2 * Scale
377
local PartWeld = Instance.new("Motor6D")
378
PartWeld.Part0 = Handle
379
PartWeld.Part1 = Part
380
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)
381
PartWeld.Parent = Part
382
383
local Part = Instance.new("Part",Model)
384
Part.CanCollide = false
385
Part.Position = Vector3.new(0,100,0)
386
Part:BreakJoints()
387
Part.FormFactor = "Custom"
388
Part.Size = Vector3.new(0.2,0.2,0.2)
389
Part.TopSurface = "SmoothNoOutlines"
390
Part.BottomSurface = "SmoothNoOutlines"
391
Part.FrontSurface = "SmoothNoOutlines"
392
Part.BackSurface = "SmoothNoOutlines"
393
Part.RightSurface = "SmoothNoOutlines"
394
Part.LeftSurface = "SmoothNoOutlines"
395
Part.BrickColor = BrickColor.new("Black")
396
local Mesh = Instance.new("BlockMesh",Part)
397
Mesh.Scale = Vector3.new(0.1,0.05,0.625) / 0.2 * Scale
398
local PartWeld = Instance.new("Motor6D")
399
PartWeld.Part0 = Handle
400
PartWeld.Part1 = Part
401
PartWeld.C0 = CFrame.Angles(math.rad(15),0,0) * CFrame.new(Vector3.new(0,0.1,-0.435)*Scale)
402
PartWeld.Parent = Part
403
404
for i = 0,80,10 do
405
	local Part = Instance.new("Part",Model)
406
	Part.CanCollide = false
407
	Part.Position = Vector3.new(0,100,0)
408
	Part:BreakJoints()
409
	Part.FormFactor = "Custom"
410
	Part.Size = Vector3.new(0.2,0.2,0.2)
411
	Part.TopSurface = "SmoothNoOutlines"
412
	Part.BottomSurface = "SmoothNoOutlines"
413
	Part.FrontSurface = "SmoothNoOutlines"
414
	Part.BackSurface = "SmoothNoOutlines"
415
	Part.RightSurface = "SmoothNoOutlines"
416
	Part.LeftSurface = "SmoothNoOutlines"
417
	Part.BrickColor = BrickColor.new("Black")
418
	local Mesh = Instance.new("BlockMesh",Part)
419
	Mesh.Scale = Vector3.new(0.25,0.15,0.03555*2) / 0.2 * Scale
420
	local PartWeld = Instance.new("Motor6D")
421
	PartWeld.Part0 = Handle
422
	PartWeld.Part1 = Part
423
	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)
424
	PartWeld.Parent = Part
425
end
426
427
local Barrel = Instance.new("Part",Model)
428
Barrel.CanCollide = false
429
Barrel.Position = Vector3.new(0,100,0)
430
Barrel:BreakJoints()
431
Barrel.FormFactor = "Custom"
432
Barrel.Size = Vector3.new(0.2,0.2,0.2)
433
Barrel.TopSurface = "SmoothNoOutlines"
434
Barrel.BottomSurface = "SmoothNoOutlines"
435
Barrel.FrontSurface = "SmoothNoOutlines"
436
Barrel.BackSurface = "SmoothNoOutlines"
437
Barrel.RightSurface = "SmoothNoOutlines"
438
Barrel.LeftSurface = "SmoothNoOutlines"
439
Barrel.BrickColor = BrickColor.new("Black")
440
local Mesh = Instance.new("BlockMesh",Barrel)
441
Mesh.Scale = Vector3.new(0.25,0.2,2) / 0.2 * Scale
442
local BarrelWeld = Instance.new("Motor6D")
443
BarrelWeld.Part0 = Handle
444
BarrelWeld.Part1 = Barrel
445
BarrelWeld.C0 = CFrame.Angles(math.rad(15),0,0) * CFrame.new(Vector3.new(0,0.5,-0.7)*Scale)
446
BarrelWeld.Parent = Barrel
447
448
local Barrel1 = Barrel
449
450
local Barrel2 = Instance.new("Part",Model)
451
Barrel2.CanCollide = false
452
Barrel2.Position = Vector3.new(0,100,0)
453
Barrel2:BreakJoints()
454
Barrel2.FormFactor = "Custom"
455
Barrel2.Size = Vector3.new(0.2,0.2,0.2)
456
Barrel2.TopSurface = "SmoothNoOutlines"
457
Barrel2.BottomSurface = "SmoothNoOutlines"
458
Barrel2.FrontSurface = "SmoothNoOutlines"
459
Barrel2.BackSurface = "SmoothNoOutlines"
460
Barrel2.RightSurface = "SmoothNoOutlines"
461
Barrel2.LeftSurface = "SmoothNoOutlines"
462
Barrel2.BrickColor = BrickColor.new("Really black")
463
local Mesh = Instance.new("BlockMesh",Barrel2)
464
Mesh.Scale = Vector3.new(0.25,0.25,2) / 0.2 * Scale
465
local Barrel2Weld = Instance.new("Motor6D")
466
Barrel2Weld.Part0 = Barrel
467
Barrel2Weld.Part1 = Barrel2
468
Barrel2Weld.C0 = CFrame.new(Vector3.new(0,0.225,0)*Scale)
469
Barrel2Weld.Parent = Barrel2
470
471
local RealBarrel = Instance.new("Part",Model)
472
RealBarrel.CanCollide = false
473
RealBarrel.Position = Vector3.new(0,100,0)
474
RealBarrel:BreakJoints()
475
RealBarrel.FormFactor = "Custom"
476
RealBarrel.Size = Vector3.new(0.2,0.2,0.2)
477
RealBarrel.TopSurface = "SmoothNoOutlines"
478
RealBarrel.BottomSurface = "SmoothNoOutlines"
479
RealBarrel.FrontSurface = "SmoothNoOutlines"
480
RealBarrel.BackSurface = "SmoothNoOutlines"
481
RealBarrel.RightSurface = "SmoothNoOutlines"
482
RealBarrel.LeftSurface = "SmoothNoOutlines"
483
RealBarrel.BrickColor = BrickColor.new("Dark grey metallic")
484
local Mesh = Instance.new("CylinderMesh",RealBarrel)
485
Mesh.Scale = Vector3.new(0.2,2,0.2) / 0.2 * Scale
486
local RealBarrelWeld = Instance.new("Motor6D")
487
RealBarrelWeld.Part0 = Barrel
488
RealBarrelWeld.Part1 = RealBarrel
489
RealBarrelWeld.C0 = CFrame.new(Vector3.new(0,0.1,-0.01)*Scale) * CFrame.Angles(math.rad(-90),0,0)
490
RealBarrelWeld.Parent = RealBarrel
491
492
for i = 1,75,15 do
493
	local Part = Instance.new("Part",Model)
494
	Part.CanCollide = false
495
	Part.Position = Vector3.new(0,100,0)
496
	Part:BreakJoints()
497
	Part.FormFactor = "Custom"
498
	Part.Size = Vector3.new(0.2,0.2,0.2)
499
	Part.TopSurface = "SmoothNoOutlines"
500
	Part.BottomSurface = "SmoothNoOutlines"
501
	Part.FrontSurface = "SmoothNoOutlines"
502
	Part.BackSurface = "SmoothNoOutlines"
503
	Part.RightSurface = "SmoothNoOutlines"
504
	Part.LeftSurface = "SmoothNoOutlines"
505
	Part.BrickColor = BrickColor.new("Black")
506
	local Mesh = Instance.new("BlockMesh",Part)
507
	Mesh.Scale = Vector3.new(0.05,0.065,0.05) / 0.2 * Scale
508
	local PartWeld = Instance.new("Motor6D")
509
	PartWeld.Part0 = Handle
510
	PartWeld.Part1 = Part
511
	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)
512
	PartWeld.Parent = Part
513
end
514
515
local Part = Instance.new("Part",Model)
516
Part.CanCollide = false
517
Part.Position = Vector3.new(0,100,0)
518
Part:BreakJoints()
519
Part.FormFactor = "Custom"
520
Part.Size = Vector3.new(0.2,0.2,0.2)
521
Part.TopSurface = "SmoothNoOutlines"
522
Part.BottomSurface = "SmoothNoOutlines"
523
Part.FrontSurface = "SmoothNoOutlines"
524
Part.BackSurface = "SmoothNoOutlines"
525
Part.RightSurface = "SmoothNoOutlines"
526
Part.LeftSurface = "SmoothNoOutlines"
527
Part.BrickColor = BrickColor.new("Really black")
528
local Mesh = Instance.new("BlockMesh",Part)
529
Mesh.Scale = Vector3.new(0.05,0.11,0.1) / 0.2 * Scale
530
local PartWeld = Instance.new("Motor6D")
531
PartWeld.Part0 = Barrel2
532
PartWeld.Part1 = Part
533
PartWeld.C0 = CFrame.new(Vector3.new(0.06,0.135,0.925)*Scale)
534
PartWeld.Parent = Part
535
536
local Part = Instance.new("Part",Model)
537
Part.CanCollide = false
538
Part.Position = Vector3.new(0,100,0)
539
Part:BreakJoints()
540
Part.FormFactor = "Custom"
541
Part.Size = Vector3.new(0.2,0.2,0.2)
542
Part.TopSurface = "SmoothNoOutlines"
543
Part.BottomSurface = "SmoothNoOutlines"
544
Part.FrontSurface = "SmoothNoOutlines"
545
Part.BackSurface = "SmoothNoOutlines"
546
Part.RightSurface = "SmoothNoOutlines"
547
Part.LeftSurface = "SmoothNoOutlines"
548
Part.BrickColor = BrickColor.new("Really black")
549
local Mesh = Instance.new("BlockMesh",Part)
550
Mesh.Scale = Vector3.new(0.05,0.11,0.1) / 0.2 * Scale
551
local PartWeld = Instance.new("Motor6D")
552
PartWeld.Part0 = Barrel2
553
PartWeld.Part1 = Part
554
PartWeld.C0 = CFrame.new(Vector3.new(-0.06,0.135,0.925)*Scale)
555
PartWeld.Parent = Part
556
557
local Part = Instance.new("Part",Model)
558
Part.CanCollide = false
559
Part.Position = Vector3.new(0,100,0)
560
Part:BreakJoints()
561
Part.FormFactor = "Custom"
562
Part.Size = Vector3.new(0.2,0.2,0.2)
563
Part.TopSurface = "SmoothNoOutlines"
564
Part.BottomSurface = "SmoothNoOutlines"
565
Part.FrontSurface = "SmoothNoOutlines"
566
Part.BackSurface = "SmoothNoOutlines"
567
Part.RightSurface = "SmoothNoOutlines"
568
Part.LeftSurface = "SmoothNoOutlines"
569
Part.BrickColor = BrickColor.new("Really black")
570
local Mesh = Instance.new("BlockMesh",Part)
571
Mesh.Scale = Vector3.new(0.025,0.1,0.1) / 0.2 * Scale
572
local PartWeld = Instance.new("Motor6D")
573
PartWeld.Part0 = Barrel2
574
PartWeld.Part1 = Part
575
PartWeld.C0 = CFrame.new(Vector3.new(0,0.135,-0.925)*Scale)
576
PartWeld.Parent = Part
577
578
local Part = Instance.new("Part",Model)
579
Part.CanCollide = false
580
Part.Position = Vector3.new(0,100,0)
581
Part:BreakJoints()
582
Part.FormFactor = "Custom"
583
Part.Size = Vector3.new(0.2,0.2,0.2)
584
Part.Transparency = 1
585
Part.TopSurface = "SmoothNoOutlines"
586
Part.BottomSurface = "SmoothNoOutlines"
587
Part.FrontSurface = "SmoothNoOutlines"
588
Part.BackSurface = "SmoothNoOutlines"
589
Part.RightSurface = "SmoothNoOutlines"
590
Part.LeftSurface = "SmoothNoOutlines"
591
Part.BrickColor = BrickColor.new("Really black")
592
local Mesh = Instance.new("BlockMesh",Part)
593
Mesh.Scale = Vector3.new(0.1,0.1,0.1) / 0.2 * Scale
594
local PartWeld = Instance.new("Motor6D")
595
PartWeld.Part0 = Barrel
596
PartWeld.Part1 = Part
597
PartWeld.C0 = CFrame.new(Vector3.new(0,0,-5)*Scale)
598
PartWeld.Parent = Part
599
600
local Light = Instance.new("PointLight",Part)
601
Light.Color = BrickColor.new("Gold").Color
602
Light.Enabled = true
603
Light.Shadows = true
604
Light.Brightness = 0
605
Light.Range = 6
606
607
local Part = Instance.new("Part",Model)
608
Part.Material = "Neon"
609
Part.CanCollide = false
610
Part.Position = Vector3.new(0,100,0)
611
Part:BreakJoints()
612
Part.FormFactor = "Custom"
613
Part.Size = Vector3.new(0.2,0.2,0.2)
614
Part.TopSurface = "SmoothNoOutlines"
615
Part.BottomSurface = "SmoothNoOutlines"
616
Part.FrontSurface = "SmoothNoOutlines"
617
Part.BackSurface = "SmoothNoOutlines"
618
Part.RightSurface = "SmoothNoOutlines"
619
Part.LeftSurface = "SmoothNoOutlines"
620
Part.BrickColor = BrickColor.new("Bright yellow")
621
Part.Transparency = 0.25
622
local RecoilMesh = Instance.new("SpecialMesh",Part)
623
RecoilMesh.MeshType = "FileMesh"
624
RecoilMesh.MeshId = "http://www.roblox.com/Asset/?id=1323306"
625
RecoilMesh.TextureId = "http://www.roblox.com/Asset/?id=98896228"
626
RecoilMesh.Scale = Vector3.new(0.175,0,0.175) * Scale
627
local PartWeld = Instance.new("Motor6D")
628
PartWeld.Part0 = RealBarrel
629
PartWeld.Part1 = Part
630
PartWeld.C0 = CFrame.new(Vector3.new(0,0.95,0)*Scale)
631
PartWeld.Parent = Part
632
633
function ShootBullet(Target,barrel)
634
	local barrel = barrel or Barrel
635
	local Bullet = Instance.new("Part",Workspace)
636
	Barrel.CanCollide = false
637
	Bullet.FormFactor = "Custom"
638
	Bullet.Size = Vector3.new(0.2,0.2,5)*Scale
639
	Bullet.TopSurface = "Smooth"
640
	Bullet.BottomSurface = "Smooth"
641
	Bullet.Anchored = true
642
	Bullet.CanCollide = false
643
	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)
644
	Bullet.Transparency = 0.1
645
	Bullet.BrickColor = BrickColor.new("Gold")
646
	--[[local Mesh = Instance.new("SpecialMesh",Bullet)
647
	Mesh.MeshType = "FileMesh"
648
	Mesh.Scale = Vector3.new(0.5,0.5,0.2)
649
	Mesh.MeshId = "http://www.roblox.com/asset/?id=2697549"
650
	--Mesh.TextureId = "http://www.roblox.com/asset/?id=2697544"]]
651
	local Mesh = Instance.new("BlockMesh",Bullet)
652
	Mesh.Scale = Vector3.new(0.2,0.2,5)*Scale/Bullet.Size
653
	IgnoreList[#IgnoreList+1] = Bullet
654
	RenderStepped:wait()
655
	for i = Speed,1000,Speed do -- Loop to do the bullet movement and stuff.
656
		local ray,Hit,Pos,SurfaceNormal;
657
		ray = Ray.new(Bullet.Position,((Bullet.CFrame*CFrame.Angles(math.rad(-Gravity),0,0)*CFrame.new(0,0,-Speed)).p-Bullet.Position).unit*Speed)
658
		Hit,Pos,SurfaceNormal = Workspace:FindPartOnRayWithIgnoreList(ray,IgnoreList)
659
		Bullet.CFrame = Bullet.CFrame*CFrame.Angles(math.rad(-Gravity),0,0)*CFrame.new(0,0,-Speed)
660
		if Hit ~= nil then
661
			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"))
662
			if Hum ~= nil then
663
				Hum:TakeDamage((((Gangster and math.random(99999,99999) or math.random(99999,99999))*Scale)/100)*Hum.MaxHealth)
664
			end
665
			break
666
		end
667
		RenderStepped:wait()
668
	end
669
	Bullet:Destroy()
670
end
671
672
Mouse.Button1Down:connect(function()
673
	if not Down and not DB then
674
		Down = true
675
		while Down do
676
			if Humanoid.Health == 0 then break end
677
			if not DB then
678
				DB = true
679
				local Sound = Instance.new("Sound",Barrel)
680
				Sound.SoundId = "http://www.roblox.com/Asset/?id=165946426" -- 132373574
681
				Sound.Volume = 5*Scale
682
				Sound.Pitch = (math.random(70,110)/100)/((Scale < 0.25 and 0.25) or (Scale > 4 and 4) or Scale)
683
				Sound:Play()
684
				Spawn(function()
685
					ShootBullet(Mouse.Hit.p,Barrel1)
686
				end)
687
				RecoilMesh.VertexColor = Vector3.new(1,math.random(160,245)/255,20/255)
688
				PartWeld.C0 = PartWeld.C0 * CFrame.Angles(0,math.rad(math.random(-40,40)),0)
689
				local Shell = Instance.new("Part",Workspace)
690
				Shell.FormFactor = "Custom"
691
				Shell.BrickColor = BrickColor.new("Bright yellow")
692
				Shell.Size = Vector3.new(0.2,0.5,0.2)*Scale
693
				Shell.CFrame = Barrel.CFrame*CFrame.new(0.5,0.5,0)*CFrame.Angles(math.rad(-90),0,0)
694
				Shell.Velocity = ((Barrel.CFrame*CFrame.new(5,0,math.random(-2,2))).p-Barrel.CFrame.p)*5*Scale
695
				local Mesh = Instance.new("CylinderMesh",Shell)
696
				Mesh.Scale = Vector3.new(0.2,0.5,0.2)*Scale/Shell.Size
697
				Spawn(function()
698
					wait(5)
699
					Shell:Destroy()
700
				end)
701
				for i = 1,20,7.5 do
702
					RotationOffset = RotationOffset*CFrame.Angles(math.rad(7.5),0,0)
703
					Part1Joint = Part1Joint*CFrame.new(Vector3.new(0,-0.15,0)*Scale)
704
					Barrel2Weld.C0 = Barrel2Weld.C0*CFrame.new(Vector3.new(0,0,0.15)*Scale)
705
					Light.Brightness = Light.Brightness+38
706
					RecoilMesh.Scale = RecoilMesh.Scale+(Vector3.new(0,0.375,0)*Scale)
707
					RenderStepped:wait()
708
				end
709
				wait(0.02)
710
				for i = 1,20,3.75 do
711
					RotationOffset = RotationOffset*CFrame.Angles(math.rad(-3.75),0,0)
712
					Part1Joint = Part1Joint*CFrame.new(Vector3.new(0,0.075,0)*Scale)
713
					Barrel2Weld.C0 = Barrel2Weld.C0*CFrame.new(Vector3.new(0,0,-0.075)*Scale)
714
					Light.Brightness = Light.Brightness-19
715
					RecoilMesh.Scale = RecoilMesh.Scale+(Vector3.new(0,-0.1875,0)*Scale)
716
					RenderStepped:wait()
717
				end
718
				wait(0.02)
719
				DB = false
720
			end
721
		end
722
	end
723
end)
724
725
Mouse.Button1Up:connect(function()
726
	Down = false
727
end)
728
729
Mouse.KeyDown:connect(function(Key)
730
	if Key:lower() == "g" and not DB then
731
		DB = true
732
		if Gangster == true then
733
			for i = 1,70,5 do
734
				RotationOffset = RotationOffset*CFrame.Angles(0,math.rad(-5),0)
735
				RenderStepped:wait()
736
			end
737
			Gangster = false
738
		else
739
			for i = 1,70,5 do
740
				RotationOffset = RotationOffset*CFrame.Angles(0,math.rad(5),0)
741
				RenderStepped:wait()
742
			end
743
			Gangster = true
744
		end
745
		DB = false
746
	end
747
end)
748
749
local Weld = Instance.new("Weld")
750
Weld.Part0 = Torso
751
Weld.Part1 = Character["Right Arm"]
752
Weld.Parent = Torso
753
754
local Weld2 = Instance.new("Weld")
755
Weld2.Part0 = Torso
756
Weld2.Part1 = Character.Head
757
Weld2.Parent = Torso
758
759
local RA = Character["Right Arm"]
760
761
game:GetService("RunService"):BindToRenderStep("Pistol",Enum.RenderPriority.Character.Value,function()
762
	local Point = Torso.CFrame:vectorToObjectSpace(Mouse.Hit.p-Torso.CFrame.p)
763
	if Point.Z > 0 then
764
		if Point.X > 0 then
765
			Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(Mouse.Hit.X,Torso.Position.Y,Mouse.Hit.Z))*CFrame.Angles(0,math.rad(90),0)
766
		elseif Point.X < 0 then
767
			Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(Mouse.Hit.X,Torso.Position.Y,Mouse.Hit.Z))*CFrame.Angles(0,math.rad(-90),0)
768
		end
769
	end
770
771
	local CFr = (Torso.CFrame*Part0Joint):toObjectSpace(CFrame.new((Torso.CFrame*Part0Joint).p,Mouse.Hit.p))--RayEnd))
772
	Weld.C0 = Part0Joint * (CFr-CFr.p) * RotationOffset
773
	Weld.C1 = Part1Joint
774
	Weld.Part0 = Torso
775
	Weld.Part1 = RA
776
	local CFr = (Torso.CFrame*Part0JointHead):toObjectSpace(CFrame.new((Torso.CFrame*Part0JointHead).p,Mouse.Hit.p))--RayEnd))
777
	Weld2.C0 = Part0JointHead * (CFr-CFr.p) * RotationOffsetHead
778
	Weld2.C1 = Part1JointHead
779
	Weld2.Part0 = Torso
780
	Weld2.Part1 = Character.Head
781
	local Last = Scale
782
	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
783
	Speed = 20*Scale
784
	if Scale ~= Last then
785
		Part0Joint = CFrame.new(Vector3.new(1,0.75,0)*Scale*1.25)
786
		Part1Joint = CFrame.new(Vector3.new(-0.5,0.75,0)*Scale*1.25)
787
		Part0JointHead = CFrame.new(Vector3.new(0,1,0)*Scale*1.25)
788
		Part1JointHead = CFrame.new(Vector3.new(0,-0.5,0)*Scale*1.25)
789
	end
790
end)