View difference between Paste ID: cAXKGpQh and szZBDrV6
SHOW: | | - or go back to the newest paste.
1
-------------------------------------------------------------------------------------------------------------------
2
if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
3
local Player,Mouse,mouse,UserInputService,ContextActionService = owner
4
do
5
    print("FE Compatibility code by Mokiros")
6
    script.Parent = Player.Character
7
 
8
    --RemoteEvent for communicating
9
    local Event = Instance.new("RemoteEvent")
10
    Event.Name = "UserInput_Event"
11
 
12
    --Fake event to make stuff like Mouse.KeyDown work
13
    local function fakeEvent()
14
        local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
15
        t.connect = t.Connect
16
        return t
17
    end
18
 
19
    --Creating fake input objects with fake variables
20
    local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
21
    local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
22
    local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
23
        CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
24
    end}
25
    --Merged 2 functions into one by checking amount of arguments
26
    CAS.UnbindAction = CAS.BindAction
27
 
28
    --This function will trigger the events that have been :Connect()'ed
29
    local function te(self,ev,...)
30
        local t = m[ev]
31
        if t and t._fakeEvent and t.Function then
32
            t.Function(...)
33
        end
34
    end
35
    m.TrigEvent = te
36
    UIS.TrigEvent = te
37
 
38
    Event.OnServerEvent:Connect(function(plr,io)
39
        if plr~=Player then return end
40
        if io.isMouse then
41
            m.Target = io.Target
42
            m.Hit = io.Hit
43
        else
44
            local b = io.UserInputState == Enum.UserInputState.Begin
45
            if io.UserInputType == Enum.UserInputType.MouseButton1 then
46
                return m:TrigEvent(b and "Button1Down" or "Button1Up")
47
            end
48
            for _,t in pairs(CAS.Actions) do
49
                for _,k in pairs(t.Keys) do
50
                    if k==io.KeyCode then
51
                        t.Function(t.Name,io.UserInputState,io)
52
                    end
53
                end
54
            end
55
            m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
56
            UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
57
        end
58
    end)
59
    Event.Parent = NLS([==[
60
    local Player = game:GetService("Players").LocalPlayer
61
    local Event = script:WaitForChild("UserInput_Event")
62
 
63
    local UIS = game:GetService("UserInputService")
64
    local input = function(io,a)
65
        if a then return end
66
        --Since InputObject is a client-side instance, we create and pass table instead
67
        Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
68
    end
69
    UIS.InputBegan:Connect(input)
70
    UIS.InputEnded:Connect(input)
71
 
72
    local Mouse = Player:GetMouse()
73
    local h,t
74
    --Give the server mouse data 30 times every second, but only if the values changed
75
    --If player is not moving their mouse, client won't fire events
76
    while wait(1/30) do
77
        if h~=Mouse.Hit or t~=Mouse.Target then
78
            h,t=Mouse.Hit,Mouse.Target
79
            Event:FireServer({isMouse=true,Target=t,Hit=h})
80
        end
81
    end]==],Player.Character)
82
    Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
83
end
84
-------------------------------------------------------------------------------------------------------------------
85
86
local plr = owner
87
local char = owner.Character
88
89
local RW = char.Torso["Right Shoulder"]
90
91
local rarmc1 = RW.C1
92
93
local resetc1 = false
94
95
function clerp(a, b, t)
96
return a:lerp(b, t)
97
end
98
99
local hold = false
100
101
local attack = false
102
103
function PlayAnimationFromTable(table, speed, bool)
104
RW.C1 = clerp(RW.C1, table[1], speed) 
105
if bool == true then
106
if resetc1 == false then
107
resetc1 = true
108
RW.C1 = rarmc1
109
end
110
end
111
end
112
113
local bull2 = Instance.new("Part",char)
114
bull2.Name = "Bullet"
115
bull2.BrickColor = BrickColor.new("Really black")
116
bull2.Size = Vector3.new(0.4, 3, 0.8)
117
bull2.CanCollide = false
118
local m = Instance.new("SpecialMesh",bull2)
119
m.MeshId = "http://www.roblox.com/asset/?id=121944778"
120
m.TextureId = "http://www.roblox.com/asset/?id=121944805"
121
122
local w = Instance.new("Weld",owner.Character["Right Arm"])
123
w.Part0 = char["Right Arm"]
124
w.Part1 = bull2
125
w.C1 = CFrame.new(-5.7220459e-06, -0.999998569, 0.900000572, 1, 6.42617621e-08, 2.73346132e-06, 2.73346086e-06, 6.70555735e-08, -1, -6.42619398e-08, 1, 6.70554101e-08)
126
127
128
function throw()
129
if Mouse.Target and attack == false then
130
attack = true
131
for i=0,1,.10 do
132
wait(0.00000000000001)
133
PlayAnimationFromTable({
134
CFrame.new(-0.5, 0.5, 0, -4.37113883e-08, 0, 1, 0.5, -0.866025329, 2.18556941e-08, 0.866025388, 0.49999997, 3.78551732e-08),
135
}, .5, true)
136
end
137
wait(0.5)
138
repeat
139
for i=0,1,.10 do
140
wait(0.00000000000001)
141
PlayAnimationFromTable({
142
CFrame.new(-0.5, 0.5, 0, -4.37113883e-08, 0, 1, -0.766044259, -0.642787695, -3.34848629e-08, 0.642787755, -0.766044199, 2.80971459e-08),
143
}, .3, true)
144
end
145
146
RW.C1 = CFrame.new(-0.5, 0.5, 0, -4.37113883e-08, 0, 1, -2.08616257e-07, 0.999999881, -7.99360578e-15, -0.99999994, -1.93715096e-07, -4.37113883e-08)
147
148
local bull = Instance.new("Part",workspace)
149
bull.Name = "Bullet"
150
bull.BrickColor = BrickColor.new("Really black")
151
bull.Size = Vector3.new(0.4, 3, 0.8)
152
bull.CanCollide = false
153
local m = Instance.new("SpecialMesh",bull)
154
m.MeshId = "http://www.roblox.com/asset/?id=121944778"
155
m.TextureId = "http://www.roblox.com/asset/?id=121944805"
156
char.HumanoidRootPart.CFrame = CFrame.new(char.HumanoidRootPart.Position, Vector3.new(mouse.Hit.Position.X, char.HumanoidRootPart.Position.Y, mouse.Hit.Position.Z))
157
bull.CFrame = bull2.CFrame
158
159
game.Debris:AddItem(bull,1)
160
161
local bv = Instance.new("BodyPosition",bull)
162
bv.D = 300
163
bv.MaxForce = Vector3.new(900000000000000000000,900000000000000000000,900000000000000000000)
164
bv.Position = Mouse.Hit.p
165
166
            bull.Touched:Connect(function(hit)
167
                if hit.Parent then
168
                    local character = hit.Parent
169
if not(character == char or hit.Name == "Bullet") then
170
if not(hit.Name == "Base" or hit.Name == "Baseplate") then
171
if hit.Name == "LowerTorso" or hit.Name == "Torso" or hit.Name == "Head" or hit.Name == "UpperTorso" or hit.Name == "Right Arm" or hit.Name == "Left Arm" or hit.Name == "Left Leg" or hit.Name == "Right Leg" or hit.Name == "LeftHand" or hit.Name == "LeftLowerArm" or hit.Name == "LeftUpperArm" or hit.Name == "RightHand" or hit.Name == "RightUpperArm" or hit.Name == "RightLowerArm" or hit.Name == "LeftUpperLeg" or hit.Name == "LeftLowerLeg" or hit.Name == "LeftFoot" or hit.Name == "RightFoot" or hit.Name == "RightUpperLeg" or hit.Name == "RightLowerLeg" and not(hit.Name == "s") then
172
if hit.Parent:FindFirstChildOfClass("Humanoid") then
173
hit.Parent:FindFirstChildOfClass("Humanoid").BreakJointsOnDeath = false
174
end
175
bull:Destroy()
176
hit.Parent = workspace
177
hit.Name = "s"
178
hit.Velocity = char.HumanoidRootPart.CFrame.LookVector * 40
179
hit.CanCollide = true
180
local kn = Instance.new("Part",hit)
181
kn.Name = "Bullet"
182
kn.Size = Vector3.new(0.4, 3, 0.8)
183
local w = Instance.new("Weld",kn)
184
w.Part0 = kn
185
local m = Instance.new("SpecialMesh",kn)
186
m.MeshId = "http://www.roblox.com/asset/?id=121944778"
187
m.TextureId = "http://www.roblox.com/asset/?id=121944805"
188
w.Part1 = hit
189
w.C0 = CFrame.new(0, 1.20000005, 0, 1, 0, 0, 0, 1.19248806e-08, -1, 0, 1, 1.19248806e-08)
190
hit:MakeJoints()
191
end
192
end
193
end
194
                end
195
            end)
196
until hold == false
197
attack = false
198
end
199
end
200
201
local stabbing = false
202
203
local stab = false
204
205
   bull2.Touched:Connect(function(hit)
206
                if hit.Parent and stabbing and hit.Parent:FindFirstChild("StabbedWithKnife") == nil then
207
                    local character = hit.Parent
208
if character ~= char and character:FindFirstChildOfClass("Humanoid") then
209
local fhum = character:FindFirstChildOfClass("Humanoid")
210
if fhum.RigType == Enum.HumanoidRigType.R6 then
211
local tors = character:FindFirstChild("Torso")
212
local ra = character:FindFirstChild("Right Arm")
213
local la = character:FindFirstChild("Left Arm")
214
local rl = character:FindFirstChild("Right Leg")
215
local ll = character:FindFirstChild("Left Leg")
216
217
local debounce = Instance.new("BoolValue",character)
218
debounce.Name = "StabbedWithKnife"
219
220
if tors then
221
if tors:FindFirstChild("Right Shoulder") then
222
tors:FindFirstChild("Right Shoulder"):Destroy()
223
end
224
if tors:FindFirstChild("Left Shoulder") then
225
tors:FindFirstChild("Left Shoulder"):Destroy()
226
end
227
if tors:FindFirstChild("Right Hip") then
228
tors:FindFirstChild("Right Hip"):Destroy()
229
end
230
if tors:FindFirstChild("Left Hip") then
231
tors:FindFirstChild("Left Hip"):Destroy()
232
end
233
if la then
234
local c1 = Instance.new("Part", fhum.Parent)
235
c1.Size = Vector3.new(1, 1 , 1)
236
c1.Transparency = 1
237
c1.Name = "lol"
238
local weld1 = Instance.new("Weld", fhum.Parent)
239
weld1.Part0 = fhum.Parent["Left Arm"]
240
weld1.Part1 = c1
241
weld1.C0 = CFrame.new(0,-0.5,0)
242
local j3 = Instance.new("Glue", fhum.Parent)
243
j3.Part0 = fhum.Parent.Torso
244
j3.Part1 = fhum.Parent["Left Arm"]
245
            j3.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
246
            j3.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
247
end
248
249
if ll then
250
local c2 = Instance.new("Part", fhum.Parent)
251
c2.Size = Vector3.new(1, 1 , 1)
252
c2.Transparency = 1
253
c2.Name = "lol"
254
local weld2 = Instance.new("Weld", fhum.Parent)
255
weld2.Part0 = fhum.Parent["Left Leg"]
256
weld2.Part1 = c2
257
weld2.C0 = CFrame.new(0,-0.5,0)
258
local j4 = Instance.new("Glue", fhum.Parent)
259
j4.Part0 = fhum.Parent.Torso
260
j4.Part1 = fhum.Parent["Left Leg"]
261
            j4.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
262
            j4.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
263
end
264
265
if ra then
266
local c3 = Instance.new("Part", fhum.Parent)
267
c3.Size = Vector3.new(1, 1 , 1)
268
c3.Transparency = 1
269
c3.Name = "lol"
270
local weld3 = Instance.new("Weld", fhum.Parent)
271
weld3.Part0 = fhum.Parent["Right Arm"]
272
weld3.Part1 = c3
273
weld3.C0 = CFrame.new(0,-0.5,0)
274
local j1 = Instance.new("Glue", fhum.Parent)
275
j1.Part0 = fhum.Parent.Torso
276
j1.Part1 = fhum.Parent["Right Arm"]
277
            j1.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
278
            j1.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
279
end
280
281
if rl then
282
local c4 = Instance.new("Part", fhum.Parent)
283
c4.Size = Vector3.new(1, 1 , 1)
284
c4.Transparency = 1
285
c4.Name = "lol"
286
local weld4 = Instance.new("Weld", fhum.Parent)
287
weld4.Part0 = fhum.Parent["Right Leg"]
288
weld4.Part1 = c4
289
weld4.C0 = CFrame.new(0,-0.5,0)
290
local j2 = Instance.new("Glue", fhum.Parent)
291
j2.Part0 = fhum.Parent.Torso
292
j2.Part1 = fhum.Parent["Right Leg"]
293
            j2.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
294
            j2.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
295
end
296
end
297
else
298
local tors = character:FindFirstChild("UpperTorso")
299
local tors2 = character:FindFirstChild("LowerTorso")
300
local ra = character:FindFirstChild("RightUpperArm")
301
local la = character:FindFirstChild("LeftUpperArm")
302
local rl = character:FindFirstChild("RightUpperLeg")
303
local ll = character:FindFirstChild("LeftUpperLeg")
304
305
local debounce = Instance.new("BoolValue",character)
306
debounce.Name = "StabbedWithKnife"
307
308
if tors then
309
if la then
310
if character:FindFirstChild("LeftLowerArm") then
311
local c1 = Instance.new("Part", fhum.Parent)
312
c1.Size = character:FindFirstChild("LeftLowerArm").Size
313
c1.Transparency = 1
314
c1.Name = "lol"
315
local weld1 = Instance.new("Weld", fhum.Parent)
316
weld1.Part0 = fhum.Parent["LeftLowerArm"]
317
weld1.Part1 = c1
318
weld1.C0 = CFrame.new(0,-0.5,0)
319
end
320
local j3 = Instance.new("Glue", fhum.Parent)
321
j3.Part0 = fhum.Parent.UpperTorso
322
j3.Part1 = fhum.Parent["LeftUpperArm"]
323
            j3.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
324
            j3.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
325
end
326
327
local j2,j4 = nil,nil
328
329
if tors2 then
330
if ll then
331
if character:FindFirstChild("LeftLowerLeg") then
332
local c2 = Instance.new("Part", fhum.Parent)
333
c2.Size = character:FindFirstChild("LeftLowerLeg").Size
334
c2.Transparency = 1
335
c2.Name = "lol"
336
local weld2 = Instance.new("Weld", fhum.Parent)
337
weld2.Part0 = fhum.Parent["LeftLowerLeg"]
338
weld2.Part1 = c2
339
weld2.C0 = CFrame.new(0,-0.5,0)
340
end
341
j4 = Instance.new("Glue", fhum.Parent)
342
j4.Part0 = fhum.Parent.LowerTorso
343
j4.Part1 = fhum.Parent["LeftUpperLeg"]
344
            --j4.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
345
            --j4.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
346
end
347
348
if rl then
349
if character:FindFirstChild("RightLowerLeg") then
350
local c4 = Instance.new("Part", fhum.Parent)
351
c4.Size = character:FindFirstChild("RightLowerLeg").Size
352
c4.Transparency = 1
353
c4.Name = "lol"
354
local weld4 = Instance.new("Weld", fhum.Parent)
355
weld4.Part0 = fhum.Parent["RightLowerLeg"]
356
weld4.Part1 = c4
357
weld4.C0 = CFrame.new(0,-0.5,0)
358
end
359
j2 = Instance.new("Glue", fhum.Parent)
360
j2.Part0 = fhum.Parent.LowerTorso
361
j2.Part1 = fhum.Parent["RightUpperLeg"]
362
            --j2.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
363
            --j2.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
364
end
365
end
366
367
if ra then
368
if character:FindFirstChild("RightLowerArm") then
369
local c3 = Instance.new("Part", fhum.Parent)
370
c3.Size = character:FindFirstChild("RightLowerArm").Size
371
c3.Transparency = 1
372
c3.Name = "lol"
373
local weld3 = Instance.new("Weld", fhum.Parent)
374
weld3.Part0 = fhum.Parent["RightLowerArm"]
375
weld3.Part1 = c3
376
weld3.C0 = CFrame.new(0,-0.5,0)
377
end
378
local j1 = Instance.new("Glue", fhum.Parent)
379
j1.Part0 = fhum.Parent.UpperTorso
380
j1.Part1 = fhum.Parent["RightUpperArm"]
381
382
            j1.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
383
            j1.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
384
end
385
386
if ra and ra:FindFirstChild("RightShoulder") then
387
if j1 then
388
j1.C0 = ra:FindFirstChild("RightShoulder").C0
389
j1.C1 = ra:FindFirstChild("RightShoulder").C1
390
end
391
ra:FindFirstChild("RightShoulder"):Destroy()
392
end
393
if la and la:FindFirstChild("LeftShoulder") then
394
if j3 then
395
j3.C0 = la:FindFirstChild("LeftShoulder").C0
396
j3.C1 = la:FindFirstChild("LeftShoulder").C1
397
end
398
la:FindFirstChild("LeftShoulder"):Destroy()
399
end
400
if rl and rl:FindFirstChild("RightHip") then
401
if j2 then
402
j2.C0 = rl:FindFirstChild("RightHip").C0
403
j2.C1 = rl:FindFirstChild("RightHip").C1
404
end
405
rl:FindFirstChild("RightHip"):Destroy()
406
end
407
if ll and ll:FindFirstChild("LeftHip") then
408
if j4 then
409
j4.C0 = ll:FindFirstChild("LeftHip").C0
410
j4.C1 = ll:FindFirstChild("LeftHip").C1
411
end
412
ll:FindFirstChild("LeftHip"):Destroy()
413
end
414
end
415
end
416
417
fhum.PlatformStand = true
418
end
419
end
420
end)
421
422
function stabf()
423
stabbing = true
424
425
char.Humanoid.WalkSpeed = 0
426
char.Humanoid.JumpPower = 0
427
428
for i=0,1,.5 do
429
wait(0.00000000000001)
430
PlayAnimationFromTable({
431
CFrame.new(0.100000024, 0.699999988, -0.100000001, -2.48745835e-07, 0.999999821, 5.96243055e-09, 0.500000119, 1.29536573e-07, -0.866025329, -0.866025209, -2.12438977e-07, -0.500000119),
432
}, .3, true)
433
end
434
435
for i=0,1,.5 do
436
wait(0.00000000000001)
437
PlayAnimationFromTable({
438
CFrame.new(0.100000024, 0.699999988, -0.100000024, -2.48745806e-07, 0.999999762, 5.96243011e-09, -0.866025209, -2.12438977e-07, -0.50000006, -0.50000006, -1.29536559e-07, 0.866025329),
439
}, .3, true)
440
end
441
442
wait(0.5)
443
RW.C1 = CFrame.new(-0.5, 0.5, 0, -4.37113883e-08, 0, 1, -2.08616257e-07, 0.999999881, -7.99360578e-15, -0.99999994, -1.93715096e-07, -4.37113883e-08)
444
stabbing = false
445
char.Humanoid.WalkSpeed = 16
446
char.Humanoid.JumpPower = 50
447
end
448
449
Mouse.Button1Up:connect(function()
450
hold = false
451
end)
452
453
Mouse.KeyDown:connect(function(k)
454
k = k:lower()
455
if k=='e' then
456
stab = not stab
457
end
458
end)
459
460
Mouse.Button1Down:connect(function()
461
if stab == false then
462
hold = true
463
throw()
464
else
465
stabf()
466
end
467
end)