Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------------------------------------------------------------------------------------------------------------
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,Mouse,mouse,UserInputService,ContextActionService = owner
- do
- print("FE Compatibility code by Mokiros")
- script.Parent = Player.Character
- --RemoteEvent for communicating
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- --Fake event to make stuff like Mouse.KeyDown work
- local function fakeEvent()
- local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
- t.connect = t.Connect
- return t
- end
- --Creating fake input objects with fake variables
- local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
- local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
- local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
- CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
- end}
- --Merged 2 functions into one by checking amount of arguments
- CAS.UnbindAction = CAS.BindAction
- --This function will trigger the events that have been :Connect()'ed
- local function te(self,ev,...)
- local t = m[ev]
- if t and t._fakeEvent and t.Function then
- t.Function(...)
- end
- end
- m.TrigEvent = te
- UIS.TrigEvent = te
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=Player then return end
- if io.isMouse then
- m.Target = io.Target
- m.Hit = io.Hit
- else
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return m:TrigEvent(b and "Button1Down" or "Button1Up")
- end
- for _,t in pairs(CAS.Actions) do
- for _,k in pairs(t.Keys) do
- if k==io.KeyCode then
- t.Function(t.Name,io.UserInputState,io)
- end
- end
- end
- m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[
- local Player = game:GetService("Players").LocalPlayer
- local Event = script:WaitForChild("UserInput_Event")
- local UIS = game:GetService("UserInputService")
- local input = function(io,a)
- if a then return end
- --Since InputObject is a client-side instance, we create and pass table instead
- Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local Mouse = Player:GetMouse()
- local h,t
- --Give the server mouse data 30 times every second, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- while wait(1/30) do
- if h~=Mouse.Hit or t~=Mouse.Target then
- h,t=Mouse.Hit,Mouse.Target
- Event:FireServer({isMouse=true,Target=t,Hit=h})
- end
- end]==],Player.Character)
- Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
- end
- -------------------------------------------------------------------------------------------------------------------
- local plr = owner
- local char = owner.Character
- local RW = char.Torso["Right Shoulder"]
- local rarmc1 = RW.C1
- local resetc1 = false
- function clerp(a, b, t)
- return a:lerp(b, t)
- end
- local hold = false
- local attack = false
- function PlayAnimationFromTable(table, speed, bool)
- RW.C1 = clerp(RW.C1, table[1], speed)
- if bool == true then
- if resetc1 == false then
- resetc1 = true
- RW.C1 = rarmc1
- end
- end
- end
- local bull2 = Instance.new("Part",char)
- bull2.Name = "Bullet"
- bull2.BrickColor = BrickColor.new("Really black")
- bull2.Size = Vector3.new(0.4, 3, 0.8)
- bull2.CanCollide = false
- local m = Instance.new("SpecialMesh",bull2)
- m.MeshId = "http://www.roblox.com/asset/?id=121944778"
- m.TextureId = "http://www.roblox.com/asset/?id=121944805"
- local w = Instance.new("Weld",owner.Character["Right Arm"])
- w.Part0 = char["Right Arm"]
- w.Part1 = bull2
- 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)
- function throw()
- if Mouse.Target and attack == false then
- attack = true
- for i=0,1,.10 do
- wait(0.00000000000001)
- PlayAnimationFromTable({
- 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),
- }, .5, true)
- end
- wait(0.5)
- repeat
- for i=0,1,.10 do
- wait(0.00000000000001)
- PlayAnimationFromTable({
- 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),
- }, .3, true)
- end
- 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)
- local bull = Instance.new("Part",workspace)
- bull.Name = "Bullet"
- bull.BrickColor = BrickColor.new("Really black")
- bull.Size = Vector3.new(0.4, 3, 0.8)
- bull.CanCollide = false
- local m = Instance.new("SpecialMesh",bull)
- m.MeshId = "http://www.roblox.com/asset/?id=121944778"
- m.TextureId = "http://www.roblox.com/asset/?id=121944805"
- char.HumanoidRootPart.CFrame = CFrame.new(char.HumanoidRootPart.Position, Vector3.new(mouse.Hit.Position.X, char.HumanoidRootPart.Position.Y, mouse.Hit.Position.Z))
- bull.CFrame = bull2.CFrame
- game.Debris:AddItem(bull,1)
- local bv = Instance.new("BodyPosition",bull)
- bv.D = 300
- bv.MaxForce = Vector3.new(900000000000000000000,900000000000000000000,900000000000000000000)
- bv.Position = Mouse.Hit.p
- bull.Touched:Connect(function(hit)
- if hit.Parent then
- local character = hit.Parent
- if not(character == char or hit.Name == "Bullet") then
- if not(hit.Name == "Base" or hit.Name == "Baseplate") then
- 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
- if hit.Parent:FindFirstChildOfClass("Humanoid") then
- hit.Parent:FindFirstChildOfClass("Humanoid").BreakJointsOnDeath = false
- end
- bull:Destroy()
- hit.Parent = workspace
- hit.Name = "s"
- hit.Velocity = char.HumanoidRootPart.CFrame.LookVector * 40
- hit.CanCollide = true
- local kn = Instance.new("Part",hit)
- kn.Name = "Bullet"
- kn.Size = Vector3.new(0.4, 3, 0.8)
- local w = Instance.new("Weld",kn)
- w.Part0 = kn
- local m = Instance.new("SpecialMesh",kn)
- m.MeshId = "http://www.roblox.com/asset/?id=121944778"
- m.TextureId = "http://www.roblox.com/asset/?id=121944805"
- w.Part1 = hit
- w.C0 = CFrame.new(0, 1.20000005, 0, 1, 0, 0, 0, 1.19248806e-08, -1, 0, 1, 1.19248806e-08)
- hit:MakeJoints()
- end
- end
- end
- end
- end)
- until hold == false
- attack = false
- end
- end
- local stabbing = false
- local stab = false
- bull2.Touched:Connect(function(hit)
- if hit.Parent and stabbing and hit.Parent:FindFirstChild("StabbedWithKnife") == nil then
- local character = hit.Parent
- if character ~= char and character:FindFirstChildOfClass("Humanoid") then
- local fhum = character:FindFirstChildOfClass("Humanoid")
- if fhum.RigType == Enum.HumanoidRigType.R6 then
- local tors = character:FindFirstChild("Torso")
- local ra = character:FindFirstChild("Right Arm")
- local la = character:FindFirstChild("Left Arm")
- local rl = character:FindFirstChild("Right Leg")
- local ll = character:FindFirstChild("Left Leg")
- local debounce = Instance.new("BoolValue",character)
- debounce.Name = "StabbedWithKnife"
- if tors then
- if tors:FindFirstChild("Right Shoulder") then
- tors:FindFirstChild("Right Shoulder"):Destroy()
- end
- if tors:FindFirstChild("Left Shoulder") then
- tors:FindFirstChild("Left Shoulder"):Destroy()
- end
- if tors:FindFirstChild("Right Hip") then
- tors:FindFirstChild("Right Hip"):Destroy()
- end
- if tors:FindFirstChild("Left Hip") then
- tors:FindFirstChild("Left Hip"):Destroy()
- end
- if la then
- local c1 = Instance.new("Part", fhum.Parent)
- c1.Size = Vector3.new(1, 1 , 1)
- c1.Transparency = 1
- c1.Name = "lol"
- local weld1 = Instance.new("Weld", fhum.Parent)
- weld1.Part0 = fhum.Parent["Left Arm"]
- weld1.Part1 = c1
- weld1.C0 = CFrame.new(0,-0.5,0)
- local j3 = Instance.new("Glue", fhum.Parent)
- j3.Part0 = fhum.Parent.Torso
- j3.Part1 = fhum.Parent["Left Arm"]
- j3.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- j3.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- end
- if ll then
- local c2 = Instance.new("Part", fhum.Parent)
- c2.Size = Vector3.new(1, 1 , 1)
- c2.Transparency = 1
- c2.Name = "lol"
- local weld2 = Instance.new("Weld", fhum.Parent)
- weld2.Part0 = fhum.Parent["Left Leg"]
- weld2.Part1 = c2
- weld2.C0 = CFrame.new(0,-0.5,0)
- local j4 = Instance.new("Glue", fhum.Parent)
- j4.Part0 = fhum.Parent.Torso
- j4.Part1 = fhum.Parent["Left Leg"]
- j4.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- j4.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- end
- if ra then
- local c3 = Instance.new("Part", fhum.Parent)
- c3.Size = Vector3.new(1, 1 , 1)
- c3.Transparency = 1
- c3.Name = "lol"
- local weld3 = Instance.new("Weld", fhum.Parent)
- weld3.Part0 = fhum.Parent["Right Arm"]
- weld3.Part1 = c3
- weld3.C0 = CFrame.new(0,-0.5,0)
- local j1 = Instance.new("Glue", fhum.Parent)
- j1.Part0 = fhum.Parent.Torso
- j1.Part1 = fhum.Parent["Right Arm"]
- j1.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- j1.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- end
- if rl then
- local c4 = Instance.new("Part", fhum.Parent)
- c4.Size = Vector3.new(1, 1 , 1)
- c4.Transparency = 1
- c4.Name = "lol"
- local weld4 = Instance.new("Weld", fhum.Parent)
- weld4.Part0 = fhum.Parent["Right Leg"]
- weld4.Part1 = c4
- weld4.C0 = CFrame.new(0,-0.5,0)
- local j2 = Instance.new("Glue", fhum.Parent)
- j2.Part0 = fhum.Parent.Torso
- j2.Part1 = fhum.Parent["Right Leg"]
- j2.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- j2.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- end
- end
- else
- local tors = character:FindFirstChild("UpperTorso")
- local tors2 = character:FindFirstChild("LowerTorso")
- local ra = character:FindFirstChild("RightUpperArm")
- local la = character:FindFirstChild("LeftUpperArm")
- local rl = character:FindFirstChild("RightUpperLeg")
- local ll = character:FindFirstChild("LeftUpperLeg")
- local debounce = Instance.new("BoolValue",character)
- debounce.Name = "StabbedWithKnife"
- if tors then
- if la then
- if character:FindFirstChild("LeftLowerArm") then
- local c1 = Instance.new("Part", fhum.Parent)
- c1.Size = character:FindFirstChild("LeftLowerArm").Size
- c1.Transparency = 1
- c1.Name = "lol"
- local weld1 = Instance.new("Weld", fhum.Parent)
- weld1.Part0 = fhum.Parent["LeftLowerArm"]
- weld1.Part1 = c1
- weld1.C0 = CFrame.new(0,-0.5,0)
- end
- local j3 = Instance.new("Glue", fhum.Parent)
- j3.Part0 = fhum.Parent.UpperTorso
- j3.Part1 = fhum.Parent["LeftUpperArm"]
- j3.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- j3.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- end
- local j2,j4 = nil,nil
- if tors2 then
- if ll then
- if character:FindFirstChild("LeftLowerLeg") then
- local c2 = Instance.new("Part", fhum.Parent)
- c2.Size = character:FindFirstChild("LeftLowerLeg").Size
- c2.Transparency = 1
- c2.Name = "lol"
- local weld2 = Instance.new("Weld", fhum.Parent)
- weld2.Part0 = fhum.Parent["LeftLowerLeg"]
- weld2.Part1 = c2
- weld2.C0 = CFrame.new(0,-0.5,0)
- end
- j4 = Instance.new("Glue", fhum.Parent)
- j4.Part0 = fhum.Parent.LowerTorso
- j4.Part1 = fhum.Parent["LeftUpperLeg"]
- --j4.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- --j4.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- end
- if rl then
- if character:FindFirstChild("RightLowerLeg") then
- local c4 = Instance.new("Part", fhum.Parent)
- c4.Size = character:FindFirstChild("RightLowerLeg").Size
- c4.Transparency = 1
- c4.Name = "lol"
- local weld4 = Instance.new("Weld", fhum.Parent)
- weld4.Part0 = fhum.Parent["RightLowerLeg"]
- weld4.Part1 = c4
- weld4.C0 = CFrame.new(0,-0.5,0)
- end
- j2 = Instance.new("Glue", fhum.Parent)
- j2.Part0 = fhum.Parent.LowerTorso
- j2.Part1 = fhum.Parent["RightUpperLeg"]
- --j2.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- --j2.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- end
- end
- if ra then
- if character:FindFirstChild("RightLowerArm") then
- local c3 = Instance.new("Part", fhum.Parent)
- c3.Size = character:FindFirstChild("RightLowerArm").Size
- c3.Transparency = 1
- c3.Name = "lol"
- local weld3 = Instance.new("Weld", fhum.Parent)
- weld3.Part0 = fhum.Parent["RightLowerArm"]
- weld3.Part1 = c3
- weld3.C0 = CFrame.new(0,-0.5,0)
- end
- local j1 = Instance.new("Glue", fhum.Parent)
- j1.Part0 = fhum.Parent.UpperTorso
- j1.Part1 = fhum.Parent["RightUpperArm"]
- j1.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- j1.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- end
- if ra and ra:FindFirstChild("RightShoulder") then
- if j1 then
- j1.C0 = ra:FindFirstChild("RightShoulder").C0
- j1.C1 = ra:FindFirstChild("RightShoulder").C1
- end
- ra:FindFirstChild("RightShoulder"):Destroy()
- end
- if la and la:FindFirstChild("LeftShoulder") then
- if j3 then
- j3.C0 = la:FindFirstChild("LeftShoulder").C0
- j3.C1 = la:FindFirstChild("LeftShoulder").C1
- end
- la:FindFirstChild("LeftShoulder"):Destroy()
- end
- if rl and rl:FindFirstChild("RightHip") then
- if j2 then
- j2.C0 = rl:FindFirstChild("RightHip").C0
- j2.C1 = rl:FindFirstChild("RightHip").C1
- end
- rl:FindFirstChild("RightHip"):Destroy()
- end
- if ll and ll:FindFirstChild("LeftHip") then
- if j4 then
- j4.C0 = ll:FindFirstChild("LeftHip").C0
- j4.C1 = ll:FindFirstChild("LeftHip").C1
- end
- ll:FindFirstChild("LeftHip"):Destroy()
- end
- end
- end
- fhum.PlatformStand = true
- end
- end
- end)
- function stabf()
- stabbing = true
- char.Humanoid.WalkSpeed = 0
- char.Humanoid.JumpPower = 0
- for i=0,1,.5 do
- wait(0.00000000000001)
- PlayAnimationFromTable({
- 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),
- }, .3, true)
- end
- for i=0,1,.5 do
- wait(0.00000000000001)
- PlayAnimationFromTable({
- 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),
- }, .3, true)
- end
- wait(0.5)
- 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)
- stabbing = false
- char.Humanoid.WalkSpeed = 16
- char.Humanoid.JumpPower = 50
- end
- Mouse.Button1Up:connect(function()
- hold = false
- end)
- Mouse.KeyDown:connect(function(k)
- k = k:lower()
- if k=='e' then
- stab = not stab
- end
- end)
- Mouse.Button1Down:connect(function()
- if stab == false then
- hold = true
- throw()
- else
- stabf()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement