View difference between Paste ID: i9LmS6vz and wSMMDnS5
SHOW: | | - or go back to the newest paste.
1
if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
2
local Player,game,owner = owner,game
3
local RealPlayer = Player
4
do
5
    print("FE Compatibility code by Mokiros")
6
    local rp = RealPlayer
7
    script.Parent = rp.Character
8
   
9
    --RemoteEvent for communicating
10
    local Event = Instance.new("RemoteEvent")
11
    Event.Name = "UserInput_Event"
12
 
13
    --Fake event to make stuff like Mouse.KeyDown work
14
    local function fakeEvent()
15
        local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
16
        t.connect = t.Connect
17
        return t
18
    end
19
 
20
    --Creating fake input objects with fake variables
21
    local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
22
    local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
23
    local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
24
        CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
25
    end}
26
    --Merged 2 functions into one by checking amount of arguments
27
    CAS.UnbindAction = CAS.BindAction
28
 
29
    --This function will trigger the events that have been :Connect()'ed
30
    local function te(self,ev,...)
31
        local t = m[ev]
32
        if t and t._fakeEvent then
33
            for _,f in pairs(t.Functions) do
34
                f(...)
35
            end
36
        end
37
    end
38
    m.TrigEvent = te
39
    UIS.TrigEvent = te
40
 
41
    Event.OnServerEvent:Connect(function(plr,io)
42
        if plr~=rp then return end
43
        m.Target = io.Target
44
        m.Hit = io.Hit
45
        if not io.isMouse then
46
            local b = io.UserInputState == Enum.UserInputState.Begin
47
            if io.UserInputType == Enum.UserInputType.MouseButton1 then
48
                return m:TrigEvent(b and "Button1Down" or "Button1Up")
49
            end
50
            for _,t in pairs(CAS.Actions) do
51
                for _,k in pairs(t.Keys) do
52
                    if k==io.KeyCode then
53
                        t.Function(t.Name,io.UserInputState,io)
54
                    end
55
                end
56
            end
57
            m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
58
            UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
59
        end
60
    end)
61
    Event.Parent = NLS([==[
62
    local Player = game:GetService("Players").LocalPlayer
63
    local Event = script:WaitForChild("UserInput_Event")
64
 
65
    local Mouse = Player:GetMouse()
66
    local UIS = game:GetService("UserInputService")
67
    local input = function(io,a)
68
        if a then return end
69
        --Since InputObject is a client-side instance, we create and pass table instead
70
        Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
71
    end
72
    UIS.InputBegan:Connect(input)
73
    UIS.InputEnded:Connect(input)
74
 
75
    local h,t
76
    --Give the server mouse data 30 times every second, but only if the values changed
77
    --If player is not moving their mouse, client won't fire events
78
    while wait(1/30) do
79
        if h~=Mouse.Hit or t~=Mouse.Target then
80
            h,t=Mouse.Hit,Mouse.Target
81
            Event:FireServer({isMouse=true,Target=t,Hit=h})
82
        end
83
    end]==],Player.Character)
84
 
85
    ----Sandboxed game object that allows the usage of client-side methods and services
86
    --Real game object
87
    local _rg = game
88
 
89
    --Metatable for fake service
90
    local fsmt = {
91
        __index = function(self,k)
92
            local s = rawget(self,"_RealService")
93
            if s then return s[k] end
94
        end,
95
        __newindex = function(self,k,v)
96
            local s = rawget(self,"_RealService")
97
            if s then s[k]=v end
98
        end,
99
        __call = function(self,...)
100
            local s = rawget(self,"_RealService")
101
            if s then return s(...) end
102
        end
103
    }
104
    local function FakeService(t,RealService)
105
        t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
106
        return setmetatable(t,fsmt)
107
    end
108
 
109
    --Fake game object
110
    local g = {
111
        GetService = function(self,s)
112
            return self[s]
113
        end,
114
        Players = FakeService({
115
            LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
116
        },"Players"),
117
        UserInputService = FakeService(UIS,"UserInputService"),
118
        ContextActionService = FakeService(CAS,"ContextActionService"),
119
    }
120
    rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
121
    g.service = g.GetService
122
   
123
    g.RunService = FakeService({
124
        RenderStepped = _rg:GetService("RunService").Heartbeat,
125
        BindToRenderStep = function(self,name,_,fun)
126
 
127
        end,
128
        UnbindFromRenderStep = function(self,name)
129
            self._btrs[name]:Disconnect()
130
        end,
131
    },"RunService")
132
 
133
    setmetatable(g,{
134
        __index=function(self,s)
135
            return _rg:GetService(s) or typeof(_rg[s])=="function"
136
            and function(_,...)return _rg[s](_rg,...)end or _rg[s]
137
        end,
138
        __newindex = fsmt.__newindex,
139
        __call = fsmt.__call
140
    })
141
    --Changing owner to fake player object to support owner:GetMouse()
142
    game,owner = g,g.Players.LocalPlayer
143
end
144
145
wait(1)
146
147
---------------------------[[[ VARIABLES ]]]---------------------------
148
149
local plr = game.Players.LocalPlayer
150
local chr = plr.Character
151
local mou = plr:GetMouse()
152
local leftarm = false
153
local active = false
154
local curkey = "f"
155
local stunneds = {}
156
157
---------------------------[[[ PARTS ]]]---------------------------
158
Instance.new("ForceField", game.Players.LocalPlayer.Character). Visible = False
159
160
-- 1 - Glock
161
obj1 = Instance.new("Model")
162
obj1.Name = "Glock"
163
obj1.Parent = chr
164
165
-- 2 - Part
166
obj2 = Instance.new("Part")
167
obj2.CFrame = CFrame.new(Vector3.new(14.25, 3.51428652, 46.8584824)) * CFrame.Angles(0.69812995195389, 0, -0)
168
obj2.TopSurface = Enum.SurfaceType.Smooth
169
obj2.BottomSurface = Enum.SurfaceType.Smooth
170
obj2.Material = Enum.Material.Neon
171
obj2.Size = Vector3.new(0.300000012, 0.200000003, 0.200000003)
172
obj2.Anchored = true
173
obj2.Friction = 0.30000001192093
174
obj2.Shape = Enum.PartType.Block
175
obj2.CanCollide = false
176
obj2.Parent = obj1
177
obj2.Transparency = 0
178
179
-- 3 - Top
180
obj3 = Instance.new("Part")
181
obj3.CFrame = CFrame.new(Vector3.new(14.25, 3.8499999, 47.1499977)) * CFrame.Angles(-0, 0, -0)
182
obj3.TopSurface = Enum.SurfaceType.Smooth
183
obj3.BottomSurface = Enum.SurfaceType.Smooth
184
obj3.Material = Enum.Material.Neon
185
obj3.Size = Vector3.new(0.300000012, 0.300000012, 1.5)
186
obj3.Anchored = true
187
obj3.Friction = 0.30000001192093
188
obj3.Shape = Enum.PartType.Block
189
obj3.CanCollide = false
190
obj3.Name = "Top"
191
obj3.Parent = obj1
192
obj3.Transparency = 0
193
-----------
194
local sound = Instance.new('Sound',obj1)
195-
	sound.SoundId = 'rbxassetid://2168518839'
195+
	sound.SoundId = 'rbxassetid://0'
196
	sound.Volume = 0.5
197
	sound.EmitterSize = 10
198
	sound.MaxDistance = 10
199
	sound.Looped = true
200
    sound:Play()
201
-----------
202
203
-- 4 - Top
204
obj4 = Instance.new("Part")
205
obj4.CFrame = CFrame.new(Vector3.new(14.25, 3.8499999, 47.8999977)) * CFrame.Angles(0, 1.5707963705063, 0)
206
obj4.TopSurface = Enum.SurfaceType.Smooth
207
obj4.BottomSurface = Enum.SurfaceType.Smooth
208
obj4.Material = Enum.Material.Neon
209
obj4.Size = Vector3.new(0.200000003, 0.299999982, 0.300000012)
210
obj4.Anchored = true
211
obj4.Friction = 0.30000001192093
212
obj4.Shape = Enum.PartType.Cylinder
213
obj4.Name = "Top"
214
obj4.CanCollide = false
215
obj4.Parent = obj1
216
obj4.Transparency = 0
217
218
-- 5 - Part
219
obj5 = Instance.new("Part")
220
obj5.CFrame = CFrame.new(Vector3.new(14.25, 3.35359001, 47.1499939)) * CFrame.Angles(-1.5707978010178, 0, -0)
221
obj5.TopSurface = Enum.SurfaceType.Smooth
222
obj5.BottomSurface = Enum.SurfaceType.Smooth
223
obj5.Material = Enum.Material.Neon
224
obj5.Size = Vector3.new(0.300000012, 0.200000003, 0.299999982)
225
obj5.Anchored = true
226
227
obj5.Friction = 0.30000001192093
228
obj5.Shape = Enum.PartType.Block
229
obj5.CanCollide = false
230
obj5.Parent = obj1
231
obj5.Transparency = 0
232
233
-- 6 - Part
234
obj6 = Instance.new("Part")
235
obj6.CFrame = CFrame.new(Vector3.new(14.25, 3.5999999, 47.1499977)) * CFrame.Angles(-0, 0, -0)
236
obj6.TopSurface = Enum.SurfaceType.Smooth
237
obj6.BottomSurface = Enum.SurfaceType.Smooth
238
obj6.Material = Enum.Material.Neon
239
obj6.Size = Vector3.new(0.300000012, 0.200000003, 1.5)
240
obj6.Anchored = true
241
obj6.CanCollide = false
242
obj6.Friction = 0.30000001192093
243
obj6.Shape = Enum.PartType.Block
244
obj6.Parent = obj1
245
obj6.Transparency = 0
246
247
-- 7 - Part
248
obj7 = Instance.new("Part")
249
obj7.CFrame = CFrame.new(Vector3.new(14.25, 3.60000014, 47.8999977)) * CFrame.Angles(0, 1.5707963705063, 0)
250
obj7.TopSurface = Enum.SurfaceType.Smooth
251
obj7.BottomSurface = Enum.SurfaceType.Smooth
252
obj7.Material = Enum.Material.Neon
253
obj7.Size = Vector3.new(0.200000003, 0.200000003, 0.300000012)
254
obj7.Anchored = true
255
obj7.CanCollide = false
256
obj7.Friction = 0.30000001192093
257
obj7.Shape = Enum.PartType.Cylinder
258
obj7.Parent = obj1
259
obj7.Transparency = 0
260
261
-- 8 - Part
262
obj8 = Instance.new("Part")
263
obj8.CFrame = CFrame.new(Vector3.new(14.25, 3.15358996, 46.8499985)) * CFrame.Angles(1.1920913323138e-007, 0, -0)
264
obj8.TopSurface = Enum.SurfaceType.Smooth
265
obj8.BottomSurface = Enum.SurfaceType.Smooth
266
obj8.Material = Enum.Material.Neon
267
obj8.Size = Vector3.new(0.300000012, 0.200000003, 0.699999988)
268
obj8.Anchored = true
269
obj8.Friction = 0.30000001192093
270
obj8.CanCollide = false
271
obj8.Shape = Enum.PartType.Block
272
obj8.Parent = obj1
273
obj8.Transparency = 0
274
275
-- 9 - Part
276
obj9 = Instance.new("Part")
277
obj9.CFrame = CFrame.new(Vector3.new(14.25, 3.27858996, 46.5067024)) * CFrame.Angles(-1.0471963882446, 0, -0)
278
obj9.TopSurface = Enum.SurfaceType.Smooth
279
obj9.BottomSurface = Enum.SurfaceType.Smooth
280
obj9.Material = Enum.Material.Neon
281
obj9.Size = Vector3.new(0.300000012, 0.300000012, 0.699999988)
282
obj9.Anchored = true
283
obj9.CanCollide = false
284
obj9.Friction = 0.30000001192093
285
obj9.Shape = Enum.PartType.Block
286
obj9.Parent = obj1
287
obj9.Transparency = 0
288
289
local previous = nil
290
for i,v in pairs(obj1:GetChildren()) do
291
	if v:IsA('BasePart') then
292
		if previous then
293
			local weld = Instance.new('Weld',v)
294
			weld.Part0 = v
295
			weld.Part1 = previous
296
			weld.C0 = v.CFrame:inverse() * previous.CFrame
297
			previous.Anchored = false
298
		end
299
		previous = v
300
	end
301
end
302
previous.Anchored = false
303
304
---------------------------[[[ FUNCTIONS ]]]---------------------------
305
306
function notify(msg,forever)
307
    local doit = coroutine.wrap(function()
308
		for i,v in pairs(plr.PlayerGui:GetChildren()) do
309
			if v.Name == "Notification" and v:IsA('ScreenGui') then
310
				v:Destroy()
311
			end
312
		end
313
        print("Original Glock made by ???")
314
        print("Edited by Knowlton to make it heavy pow and rainbow I guess")
315
        local gui = Instance.new('ScreenGui',plr.PlayerGui)
316
        gui.Name = "Notification"
317
        local frame = Instance.new('Frame',gui)
318
        frame.Position = UDim2.new(0,0,0,0)
319
        frame.Size = UDim2.new(1,0,0.2,0)
320
        frame.BackgroundTransparency = 1
321
        local txt = Instance.new('TextLabel',frame)
322
        txt.TextColor3 = Color3.new(255,255,255)
323
        txt.TextStrokeColor3 = Color3.new(0, 0, 0)
324
        txt.TextStrokeTransparency = 0
325
        txt.BackgroundTransparency = 1
326
        txt.Text = ""
327
        txt.Size = UDim2.new(1,0,0.3,0)
328
        txt.Position = UDim2.new(0,0,0.4,0)
329
        txt.TextScaled = true
330
        txt.Font = "Code"
331
        txt.TextXAlignment = "Center"
332
        local tap = Instance.new("Sound")
333
        tap.Parent = plr.Backpack
334
        tap.SoundId = "rbxassetid://147982968"
335
        tap.TimePosition = 0.1
336
        local str = msg
337
        local len = string.len(str)
338
        for i=1,len do
339
            txt.Text = string.sub(str,1,i)
340
            local pitche = math.random(2, 4)
341
            tap.PlaybackSpeed = pitche
342
            tap:Play()
343
            wait(0.05)
344
        end
345
        if forever == false then
346
            wait(1)
347
            while txt.TextTransparency < 1 do
348
                txt.TextTransparency = txt.TextTransparency + 0.1
349
                txt.TextStrokeTransparency = txt.TextStrokeTransparency + 0.1
350
                wait()
351
            end
352
            gui:Destroy()
353
        end
354
    end)
355
    doit()
356
end
357
358
359
function damage(playa,hita)
360
local hitz = hita.Name
361
local heyy = hitz
362
    if hitz == "Right Arm" then
363
    local Limb = playa:FindFirstChild("Right Arm")
364
    local ters = playa:FindFirstChild('Torso')
365
        if Limb and ters then
366
            if ters:FindFirstChild('Right Shoulder') then ters["Right Shoulder"]:Destroy() end
367
            for i,v in pairs(Limb:GetChildren()) do
368
                if v:IsA('Weld') or v:IsA('Motor6D') or v:IsA('Glue') then
369
                    v:Destroy()
370
                end
371
            end
372
            Limb.CFrame = ters.CFrame * CFrame.new(1.5, 0, 0)
373
            local Joint = Instance.new("Glue")
374
            Joint.Name = "RightShoulder"
375
            Joint.Part0 = ters
376
            Joint.Part1 = Limb
377
            Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
378
            Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
379
            Joint.Parent = ters
380
 
381
            local B = Instance.new("Part")
382
            B.TopSurface = 0
383
            B.BottomSurface = 0
384
            B.formFactor = "Symmetric"
385
            B.Size = Vector3.new(1, 1, 1)
386
            B.Transparency = 1
387
            B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
388
            B.Parent = playa
389
            local W = Instance.new("Weld")
390
            W.Part0 = Limb
391
            W.Part1 = B
392
            W.C0 = CFrame.new(0, -0.5, 0)
393
            W.Parent = Limb
394
        end
395
    elseif hitz == "Left Arm" then
396
        local Limb = playa:FindFirstChild("Left Arm")
397
    local ters = playa:FindFirstChild('Torso')
398
        if Limb and ters then
399
            if ters:FindFirstChild('Left Shoulder') then ters["Left Shoulder"]:Destroy() end
400
            for i,v in pairs(Limb:GetChildren()) do
401
                if v:IsA('Weld') or v:IsA('Motor6D') or v:IsA('Glue') then
402
                    v:Destroy()
403
                end
404
            end
405
            Limb.CFrame = ters.CFrame * CFrame.new(-1.5, 0, 0)
406
            local Joint = Instance.new("Glue")
407
            Joint.Name = "LeftShoulder"
408
            Joint.Part0 = ters
409
            Joint.Part1 = Limb
410
            Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
411
            Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
412
            Joint.Parent = ters
413
            local B = Instance.new("Part")
414
            B.TopSurface = 0
415
            B.BottomSurface = 0
416
            B.formFactor = "Symmetric"
417
            B.Size = Vector3.new(1, 1, 1)
418
            B.Transparency = 1
419
            B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
420
            B.Parent = playa
421
            local W = Instance.new("Weld")
422
            W.Part0 = ters
423
            W.Part1 = B
424
            W.C0 = CFrame.new(0, -0.5, 0)
425
            W.Parent = Limb
426
        end
427
    elseif hitz == "Right Leg" then
428
        local Limb = playa:FindFirstChild("Right Leg")
429
    local ters = playa:FindFirstChild('Torso')
430
        if Limb and ters then
431
            if ters:FindFirstChild('Right Hip') then ters["Right Hip"]:Destroy() end
432
            for i,v in pairs(Limb:GetChildren()) do
433
                if v:IsA('Weld') or v:IsA('Motor6D') or v:IsA('Glue') then
434
                    v:Destroy()
435
                end
436
            end
437
        Limb.CFrame = ters.CFrame * CFrame.new(0.5, -2, 0)
438
            local Joint = Instance.new("Glue")
439
            Joint.Name = "Right Hip"
440
            Joint.Part0 = ters
441
            Joint.Part1 = Limb
442
            Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
443
            Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
444
            Joint.Parent = ters
445
            local B = Instance.new("Part")
446
            B.TopSurface = 0
447
            B.BottomSurface = 0
448
            B.formFactor = "Symmetric"
449
            B.Size = Vector3.new(1, 1, 1)
450
            B.Transparency = 1
451
            B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
452
            B.Parent = playa
453
            local W = Instance.new("Weld")
454
            W.Part0 = Limb
455
            W.Part1 = B
456
            W.C0 = CFrame.new(0, -0.5, 0)
457
            W.Parent = Limb
458
			if playa:FindFirstChildOfClass('Humanoid') then
459
				local hum = playa:FindFirstChildOfClass('Humanoid')
460
				local target = playa
461
				if target:FindFirstChild('HumanoidRootPart') then
462
					target.HumanoidRootPart:Destroy()
463
				end
464
				local found = false
465
				for i,v in pairs(stunneds) do
466
					if v == hum then
467
						found = true
468
					end
469
				end
470
				if found == false then
471
					table.insert(stunneds,hum)
472
				end
473
			end
474
        end
475
    elseif hitz == "Left Leg" then
476
        local Limb = playa:FindFirstChild("Left Leg")
477
    local ters = playa:FindFirstChild('Torso')
478
        if Limb and ters then
479
            if ters:FindFirstChild('Left Hip') then ters["Left Hip"]:Destroy() end
480
            for i,v in pairs(Limb:GetChildren()) do
481
                if v:IsA('Weld') or v:IsA('Motor6D') or v:IsA('Glue') then
482
                    v:Destroy()
483
                end
484
            end
485
        Limb.CFrame = ters.CFrame * CFrame.new(0.5, -2, 0)
486
            Limb.CFrame = ters.CFrame * CFrame.new(-0.5, -2, 0)
487
            local Joint = Instance.new("Glue")
488
            Joint.Name = "LeftHip"
489
            Joint.Part0 = ters
490
            Joint.Part1 = Limb
491
            Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
492
            Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
493
            Joint.Parent = ters
494
 
495
            local B = Instance.new("Part")
496
            B.TopSurface = 0
497
            B.BottomSurface = 0
498
            B.formFactor = "Symmetric"
499
            B.Size = Vector3.new(1, 1, 1)
500
            B.Transparency = 1
501
            B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
502
            B.Parent = playa
503
            local W = Instance.new("Weld")
504
            W.Part0 = Limb
505
            W.Part1 = B
506
            W.C0 = CFrame.new(0, -0.5, 0)
507
            W.Parent = Limb
508
            Limb.CanCollide = false
509
			if playa:FindFirstChildOfClass('Humanoid') then
510
				local hum = playa:FindFirstChildOfClass('Humanoid')
511
				local target = playa
512
				if target:FindFirstChild('HumanoidRootPart') then
513
					target.HumanoidRootPart:Destroy()
514
				end
515
				local found = false
516
				for i,v in pairs(stunneds) do
517
					if v == hum then
518
						found = true
519
					end
520
				end
521
				if found == false then
522
					table.insert(stunneds,hum)
523
				end
524
			end
525
        end
526
    else
527
        local playa2 = playa
528
        playa.Archivable = true
529
        local playa = playa:Clone()
530
        playa.Archivable = false
531
        playa2:Destroy()
532
        playa.Parent = workspace
533
        local Gibs = game.Workspace
534
print(playa)
535
        local Torso = playa.Torso
536
        local Head = playa:FindFirstChild("Head")
537
        local function Scan(ch)
538
        local e
539
        for e = 1,#ch do
540
            Scan(ch[e]:GetChildren())
541
            if ch[e].ClassName == "Weld"  or ch[e].ClassName == "Motor6D" then
542
                ch[e]:remove()
543
            end
544
        end
545
    end
546
    Scan(playa:GetChildren())
547
        if playa:FindFirstChild('HumanoidRootPart') then
548
            playa:FindFirstChild('HumanoidRootPart'):Destroy()
549
        end
550
        local hum2 = playa:FindFirstChildOfClass("Humanoid")
551
 
552
 
553
    if hum2 ~= nil then
554
        hum2.Name = "Humanoid2"
555
        hum2.PlatformStand = true
556
        hum2.Health = 0
557
    end
558
    local ch = playa:GetChildren()
559
    local i
560
    for i = 1,#ch do
561
        if ch[i].Name == "THandle1" or ch[i].Name == "THandle2" then
562
            ch[i]:remove()
563
        end
564
    end
565
 
566
        if Head then
567
            local Neck = Instance.new("Weld")
568
            Neck.Name = "Neck"
569
            Neck.Part0 = Torso
570
            Neck.Part1 = Head
571
            Neck.C0 = CFrame.new(0, 1.5, 0)
572
            Neck.C1 = CFrame.new()
573
            Neck.Parent = Torso
574
        end
575
        local Limb = playa:FindFirstChild("Right Arm")
576
        if Limb then
577
 
578
            Limb.CFrame = Torso.CFrame * CFrame.new(1.5, 0, 0)
579
            local Joint = Instance.new("Glue")
580
            Joint.Name = "RightShoulder"
581
            Joint.Part0 = Torso
582
            Joint.Part1 = Limb
583
            Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
584
            Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
585
            Joint.Parent = Torso
586
 
587
            local B = Instance.new("Part")
588
            B.TopSurface = 0
589
            B.BottomSurface = 0
590
            B.formFactor = "Symmetric"
591
            B.Size = Vector3.new(1, 1, 1)
592
            B.Transparency = 1
593
            B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
594
            B.Parent = playa
595
            local W = Instance.new("Weld")
596
            W.Part0 = Limb
597
            W.Part1 = B
598
            W.C0 = CFrame.new(0, -0.5, 0)
599
            W.Parent = Limb
600
        end
601
        local Limb = playa:FindFirstChild("Left Arm")
602
        if Limb then
603
 
604
            Limb.CFrame = Torso.CFrame * CFrame.new(-1.5, 0, 0)
605
            local Joint = Instance.new("Glue")
606
            Joint.Name = "LeftShoulder"
607
            Joint.Part0 = Torso
608
            Joint.Part1 = Limb
609
            Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
610
            Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
611
            Joint.Parent = Torso
612
 
613
            local B = Instance.new("Part")
614
            B.TopSurface = 0
615
            B.BottomSurface = 0
616
            B.formFactor = "Symmetric"
617
            B.Size = Vector3.new(1, 1, 1)
618
            B.Transparency = 1
619
            B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
620
            B.Parent = playa
621
            local W = Instance.new("Weld")
622
            W.Part0 = Limb
623
            W.Part1 = B
624
            W.C0 = CFrame.new(0, -0.5, 0)
625
            W.Parent = Limb
626
        end
627
        local Limb = playa:FindFirstChild("Right Leg")
628
        if Limb then
629
 
630
            Limb.CFrame = Torso.CFrame * CFrame.new(0.5, -2, 0)
631
            local Joint = Instance.new("Glue")
632
            Joint.Name = "RightHip"
633
            Joint.Part0 = Torso
634
            Joint.Part1 = Limb
635
            Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
636
            Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
637
            Joint.Parent = Torso
638
 
639
            local B = Instance.new("Part")
640
            B.TopSurface = 0
641
            B.BottomSurface = 0
642
            B.formFactor = "Symmetric"
643
            B.Size = Vector3.new(1, 1, 1)
644
            B.Transparency = 1
645
            B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
646
            B.Parent = playa
647
            local W = Instance.new("Weld")
648
            W.Part0 = Limb
649
            W.Part1 = B
650
            W.C0 = CFrame.new(0, -0.5, 0)
651
            W.Parent = Limb
652
        end
653
        local Limb = playa:FindFirstChild("Left Leg")
654
        if Limb then
655
 
656
            Limb.CFrame = Torso.CFrame * CFrame.new(-0.5, -2, 0)
657
            local Joint = Instance.new("Glue")
658
            Joint.Name = "LeftHip"
659
            Joint.Part0 = Torso
660
            Joint.Part1 = Limb
661
            Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
662
            Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
663
            Joint.Parent = Torso
664
 
665
            local B = Instance.new("Part")
666
            B.TopSurface = 0
667
            B.BottomSurface = 0
668
            B.formFactor = "Symmetric"
669
            B.Size = Vector3.new(1, 1, 1)
670
            B.Transparency = 1
671
            B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
672
            B.Parent = playa
673
            local W = Instance.new("Weld")
674
            W.Part0 = Limb
675
            W.Part1 = B
676
            W.C0 = CFrame.new(0, -0.5, 0)
677
            W.Parent = Limb
678
        end
679
        --[
680
        local Bar = Instance.new("Part")
681
        Bar.TopSurface = 0
682
        Bar.BottomSurface = 0
683
        Bar.formFactor = "Symmetric"
684
        Bar.Size = Vector3.new(1, 1, 1)
685
        Bar.Transparency = 1
686
        Bar.CFrame = Torso.CFrame * CFrame.new(0, 0.5, 0)
687
        Bar.Parent = playa
688
        local Weld = Instance.new("Weld")
689
        Weld.Part0 = Torso
690
        Weld.Part1 = Bar
691
        Weld.C0 = CFrame.new(0, 0.5, 0)
692
        Weld.Parent = Torso
693
        --]]
694
        playa.Parent = Gibs
695
    game.Debris:AddItem(playa, 12)
696
    end
697
end
698
699
700
function calculate()
701
	if leftarm and chr:FindFirstChild('Head') and chr:FindFirstChild('Torso') and chr.Torso:FindFirstChild("Left Shoulder") and chr:FindFirstChild('Left Arm') then
702
	local Head = plr.Character.Head
703
        local RightShoulder = plr.Character.Torso["Left Shoulder"]
704
        local RightArm = plr.Character["Left Arm"]
705
        local MousePosition = mou.Hit.p
706
        local ToMouse = (MousePosition - Head.Position).unit
707
        local Angle = math.acos(ToMouse:Dot(Vector3.new(0, 1, 0)))
708
        local FromRightArmPos = (Head.Position + Head.CFrame:vectorToWorldSpace(Vector3.new(((-Head.Size.X / 2) + (-RightArm.Size.X / 2)), ((-Head.Size.Y / 2) - (-RightArm.Size.Z / 2)), 0)))
709
        local ToMouseRightArm = ((MousePosition - FromRightArmPos) * Vector3.new(-1 ,0, -1)).unit
710
        local Look = (Head.CFrame.lookVector * Vector3.new(-1, 0, -1)).unit
711
        local LateralAngle = math.acos(ToMouseRightArm:Dot(Look))
712
        if tostring(LateralAngle) == "-1.#IND" then
713
            LateralAngle = 0
714
        end
715
        local Cross = Head.CFrame.lookVector:Cross(ToMouseRightArm)
716
       --[[
717
 		if LateralAngle > (math.pi / 2) then
718
            LateralAngle = (math.pi / 2)
719
			if chr:FindFirstChild('Torso') then
720
				local Torso = chr.Torso
721
				local Point = Torso.CFrame:vectorToObjectSpace(mou.Hit.p-Torso.CFrame.p)
722
				if Point.Z > 0 then
723
					if Point.X > 0 then
724
						Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mou.Hit.X,Torso.Position.Y,mou.Hit.Z))*CFrame.Angles(0,math.rad(90),0)
725
					elseif Point.X < 0 then
726
						Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mou.Hit.X,Torso.Position.Y,mou.Hit.Z))*CFrame.Angles(0,math.rad(-90),0)
727
					end
728
				end
729
			end
730
        end
731
]]--
732
print(LateralAngle)
733
warn(math.pi / 2)
734
        if Cross.Y < 0 then
735
            LateralAngle = -LateralAngle
736
        end
737
        return(CFrame.new(RightShoulder.C0.p) * CFrame.Angles(((math.pi / 2) - Angle), ((math.pi / 2) + LateralAngle), math.pi/2))
738
	elseif chr:FindFirstChild('Head') and chr:FindFirstChild('Torso') and chr.Torso:FindFirstChild("Right Shoulder") and chr:FindFirstChild('Right Arm') then
739
		local Head = plr.Character.Head
740
        local RightShoulder = plr.Character.Torso["Right Shoulder"]
741
        local RightArm = plr.Character["Right Arm"]
742
        local MousePosition = mou.Hit.p
743
        local ToMouse = (MousePosition - Head.Position).unit
744
        local Angle = math.acos(ToMouse:Dot(Vector3.new(0, 1, 0)))
745
        local FromRightArmPos = (Head.Position + Head.CFrame:vectorToWorldSpace(Vector3.new(((Head.Size.X / 2) + (RightArm.Size.X / 2)), ((Head.Size.Y / 2) - (RightArm.Size.Z / 2)), 0)))
746
        local ToMouseRightArm = ((MousePosition - FromRightArmPos) * Vector3.new(1 ,0, 1)).unit
747
        local Look = (Head.CFrame.lookVector * Vector3.new(1, 0, 1)).unit
748
        local LateralAngle = math.acos(ToMouseRightArm:Dot(Look))
749
        if tostring(LateralAngle) == "-1.#IND" then
750
            LateralAngle = 0
751
        end
752
        local Cross = Head.CFrame.lookVector:Cross(ToMouseRightArm)
753
        if LateralAngle > (math.pi / 2) then
754
            LateralAngle = (math.pi / 2)
755
			if chr:FindFirstChild('Torso') then
756
				local Torso = chr.Torso
757
				local Point = Torso.CFrame:vectorToObjectSpace(mou.Hit.p-Torso.CFrame.p)
758
				if Point.Z > 0 then
759
					if Point.X > 0 then
760
						Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mou.Hit.X,Torso.Position.Y,mou.Hit.Z))*CFrame.Angles(0,math.rad(90),0)
761
					elseif Point.X < 0 then
762
						Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mou.Hit.X,Torso.Position.Y,mou.Hit.Z))*CFrame.Angles(0,math.rad(-90),0)
763
					end
764
				end
765
			end
766
        end
767
        if Cross.Y < 0 then
768
            LateralAngle = -LateralAngle
769
        end
770
        return(CFrame.new(RightShoulder.C0.p) * CFrame.Angles(((math.pi / 2) - Angle), ((math.pi / 2) + LateralAngle), math.pi/2))
771
	end
772
end
773
774
function fire()
775
	if mou.Target then
776
		local humanoid = mou.Target.Parent:FindFirstChildOfClass("Humanoid")
777
		if not humanoid then
778
			humanoid = mou.Target.Parent.Parent:FindFirstChildOfClass("Humanoid")
779
		end
780
		if humanoid then
781
			local coru = coroutine.wrap(function()
782
				damage(humanoid.Parent,mou.Target)
783
			end)
784
			coru()
785
		end
786
	end
787
	local beam = Instance.new("Part", workspace)
788
	beam.BrickColor = BrickColor.random()
789
	beam.FormFactor = "Custom"
790
	beam.Material = "Neon"
791
	beam.Transparency = 0
792
	beam.Anchored = true
793
	beam.Locked = true
794
	beam.CanCollide = false
795
	local distance = (obj4.CFrame.p - mou.Hit.p).magnitude
796
	beam.Size = Vector3.new(0.2, 0.2, distance)
797
	beam.CFrame = CFrame.new(obj4.CFrame.p, mou.Hit.p) * CFrame.new(0, 0, -distance / 2)
798
	game:GetService("Debris"):AddItem(beam, 0.05)
799
	local sound = Instance.new('Sound',obj4)
800-
	sound.SoundId = 'rbxassetid://135362176'
800+
	sound.SoundId = 'rbxassetid://130791043'
801
	sound.Volume = 8 
802
	sound.EmitterSize = 40
803
	sound.MaxDistance = 450
804
	sound:Play()
805
	game:GetService("Debris"):AddItem(beam, sound.TimeLength)
806
end
807
808
809
---------------------------[[[ SCRIPT ]]]---------------------------
810
	CFuncs = {	
811
	["Part"] = {
812
		Create = function(Parent, Material, Reflectance, Transparency, BColor, Name, Size )
813
			local Part = Create("Part"){
814
				Parent = Parent,
815
				Reflectance = Reflectance,
816
				Transparency = Transparency,
817
				CanCollide = false,
818
				Locked = true,
819
				BrickColor = BrickColor.random(),
820
				Name = Name,
821
				Size = Size,
822
				Material = Material,
823
			}
824
			RemoveOutlines(Part)
825
			return Part
826
		end;
827
	};
828
	
829
	["Mesh"] = {
830
		Create = function(Mesh, Part, MeshType, MeshId, OffSet, Scale)
831
			local Msh = Create(Mesh){
832
				Parent = Part,
833
				Offset = OffSet,
834
				Scale = Scale,
835
			}
836
			if Mesh == "SpecialMesh" then
837
				Msh.MeshType = MeshType
838
				Msh.MeshId = MeshId
839
			end
840
			return Msh
841
		end;
842
	};
843
	
844
	["Mesh"] = {
845
		Create = function(Mesh, Part, MeshType, MeshId, OffSet, Scale)
846
			local Msh = Create(Mesh){
847
				Parent = Part,
848
				Offset = OffSet,
849
				Scale = Scale,
850
			}
851
			if Mesh == "SpecialMesh" then
852
				Msh.MeshType = MeshType
853
				Msh.MeshId = MeshId
854
			end
855
			return Msh
856
		end;
857
	};
858
	
859
	["Weld"] = {
860
		Create = function(Parent, Part0, Part1, C0, C1)
861
			local Weld = Create("Weld"){
862
				Parent = Parent,
863
				Part0 = Part0,
864
				Part1 = Part1,
865
				C0 = C0,
866
				C1 = C1,
867
			}
868
			return Weld
869
		end;
870
	};
871
872
	["Sound"] = {
873
		Create = function(id, par, vol, pit) 
874
			coroutine.resume(coroutine.create(function()
875
				local S = Create("Sound"){
876
					Volume = vol,
877
					Pitch = pit or 1,
878
					SoundId = id,
879
					Parent = par or workspace,
880
				}
881
				wait() 
882
				S:play() 
883
				game:GetService("Debris"):AddItem(S, 6)
884
			end))
885
		end;
886
	};
887
	
888
	["ParticleEmitter"] = {
889
		Create = function(Parent, Color1, Color2, LightEmission, Size, Texture, Transparency, ZOffset, Accel, Drag, LockedToPart, VelocityInheritance, EmissionDirection, Enabled, LifeTime, Rate, Rotation, RotSpeed, Speed, VelocitySpread)
890
			local fp = Create("ParticleEmitter"){
891
				Parent = Parent, 
892
				Color = ColorSequence.new(Color1, Color2), 
893
				LightEmission = LightEmission,
894
				Size = Size,
895
				Texture = Texture,
896
				Transparency = Transparency,
897
				ZOffset = ZOffset,
898
				Acceleration = Accel,
899
				Drag = Drag,
900
				LockedToPart = LockedToPart,
901
				VelocityInheritance = VelocityInheritance,
902
				EmissionDirection = EmissionDirection,
903
				Enabled = Enabled,
904
				Lifetime = LifeTime,
905
				Rate = Rate,
906
				Rotation = Rotation,
907
				RotSpeed = RotSpeed,
908
				Speed = Speed,
909
				VelocitySpread = VelocitySpread,
910
			}
911
			return fp
912
		end;
913
	};
914
915
	CreateTemplate = {
916
	
917
	};
918
}
919
    
920
    sound = Instance.new("Sound", Character)
921
    sound.SoundId = "rbxassetid://362573120"
922
    sound.Volume = 6
923
    sound.Pitch = 1.2
924
    sound.EmitterSize = 100
925
    sound:Play()
926
    sound.Looped = true
927
if chr:FindFirstChild('Left Arm') == nil or chr:FindFirstChild('Torso') == nil or chr.Torso:FindFirstChild('Left Shoulder') == nil then
928
	leftarm = false
929
end
930
local weldas = Instance.new('Weld',obj2)
931
if leftarm and chr:FindFirstChild('Left Arm') then
932
	weldas.Part0 = obj2
933
	weldas.Part1 = chr["Left Arm"]
934
	weldas.C0 = CFrame.new(0,-0.85,-0.30)*CFrame.Angles(math.rad(50),math.rad(0),math.rad(180))
935
elseif chr:FindFirstChild('Right Arm') then
936
	weldas.Part0 = obj2
937
	weldas.Part1 = chr["Right Arm"]
938
	weldas.C0 = CFrame.new(0,-0.85,-0.30)*CFrame.Angles(math.rad(50),math.rad(0),math.rad(180))
939
end
940
941
942
if leftarm and chr:FindFirstChild('Left Arm') and chr:FindFirstChild('Torso') and chr.Torso:FindFirstChild('Left Shoulder') then
943
	chr:FindFirstChild('Left Arm').AncestryChanged:connect(function(me,par)
944
		if par ~= chr and chr:FindFirstChild('Right Arm') then
945
			if obj2 and obj2:FindFirstChildOfClass('Weld') then
946
				obj2:FindFirstChildOfClass('Weld').Part1 = chr["Right Arm"]
947
			end
948
			leftarm = false
949
		end
950
	end)
951
	chr.Torso:FindFirstChild('Left Shoulder').AncestryChanged:connect(function(me,par)
952
		if par ~= chr:FindFirstChild('Torso') and chr:FindFirstChild('Right Arm') then
953
			if obj2 and obj2:FindFirstChildOfClass('Weld') then
954
				obj2:FindFirstChildOfClass('Weld').Part1 = chr["Right Arm"]
955
			end
956
		end
957
		leftarm = false
958
	end)
959
elseif leftarm then
960
	if obj2 and obj2:FindFirstChildOfClass('Weld') and chr:FindFirstChild('Right Arm') then
961
		obj2:FindFirstChildOfClass('Weld').Part1 = chr["Right Arm"]
962
	end
963
end
964
965
mou.KeyDown:connect(function(key)
966
	if key == string.lower(curkey) then
967
		active = not active
968
	end
969
end)
970
971
plr.Chatted:connect(function(msg)
972
	if string.lower(string.sub(msg,1,5)) == "!bind" then
973
		curkey = string.lower(string.sub(msg,7,7))
974
		notify([[Changed key for equip/unequip to "]]..curkey..[[".]],false)
975
	end
976
end)
977
978
game:GetService('RunService').Stepped:connect(function()
979
	if active and chr:FindFirstChild('Torso') then
980
		if leftarm then
981
			chr.Torso["Left Shoulder"].C0 = calculate()
982
		else
983
			chr.Torso["Right Shoulder"].C0 = calculate()
984
		end
985
		weldas.Part1 = chr["Right Arm"]
986
	weldas.C0 = CFrame.new(0,-0.85,-0.30)*CFrame.Angles(math.rad(50),math.rad(0),math.rad(180))
987
	elseif chr:FindFirstChild('Torso') and (chr.Torso:FindFirstChild('Left Shoulder') or chr.Torso:FindFirstChild('Right Shoulder')) then
988
		if leftarm then
989
			chr.Torso["Left Shoulder"].C0 = CFrame.new(-1,0.5,0)*CFrame.Angles(0,-math.pi/2,0)
990
		else
991
			chr.Torso["Right Shoulder"].C0 = CFrame.new(1,0.5,0)*CFrame.Angles(0,math.pi/2,0)
992
		end
993
		weldas.Part1 = chr.Torso
994
		weldas.C0 = CFrame.new(-1,0,-1)*CFrame.Angles(math.rad(-90),0,0)
995
	end
996
	for i,v in pairs(stunneds) do
997
		v.PlatformStand = true
998
	end
999
end)
1000
1001
mou.Button1Down:connect(function()
1002
	if active then
1003
		fire()
1004
	    end
1005
    end)
1006
print("Original Glock made by ???") 
1007
print("Edited by Knowlton to make it heavy pow and rainbow I guess")
1008
---------------
1009
while true do
1010
obj2.BrickColor = BrickColor.new (math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random())
1011
obj3.BrickColor = BrickColor.new (math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random())
1012
obj4.BrickColor = BrickColor.new (math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random())
1013
obj5.BrickColor = BrickColor.new (math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random())
1014
obj6.BrickColor = BrickColor.new (math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random())
1015
obj7.BrickColor = BrickColor.new (math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random())
1016
obj8.BrickColor = BrickColor.new (math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random())
1017
obj9.BrickColor = BrickColor.new (math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random())
1018
wait(0.1)
1019
----------------
1020
end
1021
notify([["Press "f" to equip/unequip, now start powing."]],false)