Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Knock = {}
- local ServerScriptService = game:GetService("ServerScriptService")
- local Cooldown_M = require(ServerScriptService["Cooldown"]);
- local Glue = function(name, part1, part2, c0, c1)
- local gloo = Instance.new("Glue")
- gloo.Name = name
- gloo.C0 = c0
- gloo.C1 = c1
- gloo.Part0 = part1
- gloo.Part1 = part2
- gloo.Parent = part1
- end
- local Motor = function(name, part1, part2, c0, c1)
- local motor = Instance.new("Motor6D")
- motor.Name = name
- motor.C0 = c0
- motor.C1 = c1
- motor.Part0 = part1
- motor.Part1 = part2
- motor.Parent = part1
- end
- local Touchy = function(parent)
- local pr = Instance.new("Part")
- pr.Name = "Touchy"
- pr.Size = Vector3.new(1 * 1, 1 * 1, 1 * 1)
- pr.Transparency = 1
- pr.Massless = true
- pr.CustomPhysicalProperties = PhysicalProperties.new(0.55, 0.3, 0.5)
- pr.CanCollide = true
- pr.Anchored = false
- pr.Parent = parent
- local w = Instance.new("Weld")
- w.Part0 = pr
- w.Part1 = parent
- w.C0 = CFrame.new(0, 0.5, 0)
- w.Parent = pr
- end
- local Get_Parts = function(player)
- local Character = player.Character
- return {
- ["Character"] = Character,
- ["Humanoid"] = Character["Humanoid"],
- ["Torso"] = Character["Torso"],
- ["RARM"] = Character["Right Arm"],
- ["LARM"] = Character["Left Arm"],
- ["RLEG"] = Character["Right Leg"],
- ["LLEG"] = Character["Left Leg"],
- ["HRP"] = Character["HumanoidRootPart"],
- ["Head"] = Character["Head"]
- }
- end
- local Positions = {
- ["Knock"] = {
- ["RightShoulderC0"] = CFrame.new(1.5 * 1, 0.5 * 1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0),
- ["RightShoulderC1"] = CFrame.new(0, 0.5 * 1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0),
- ["LeftShoulderC0"] = CFrame.new(-1.5 * 1, 0.5 * 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),
- ["LeftShoulderC1"] = CFrame.new(0, 0.5 * 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),
- ["RightHipC0"] = CFrame.new(0.5 * 1, -1 * 1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0),
- ["RightHipC1"] = CFrame.new(0, 1 * 1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0),
- ["LeftHipC0"] = CFrame.new(-0.5 * 1, -1 * 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),
- ["LeftHipC1"] = CFrame.new(0 * 1, 1 * 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),
- },
- ["GetUp"] = {
- ["RightShoulderC0"] = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0),
- ["RightShoulderC1"] = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0),
- ["LeftShoulderC0"] = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),
- ["LeftShoulderC1"] = CFrame.new(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),
- ["RightHipC0"] = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0),
- ["RightHipC1"] = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0),
- ["LeftHipC0"] = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),
- ["LeftHipC1"] = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0),
- }
- }
- local MotorSystem = function(Character, Choice)
- return {
- ["Right Shoulder"] = {
- ["Limb"] = Character["RARM"],
- ["C"] = {
- Positions[Choice]["RightShoulderC0"],
- Positions[Choice]["RightShoulderC1"]
- }
- },
- ["Left Shoulder"] = {
- ["Limb"] = Character["LARM"],
- ["C"] = {
- Positions[Choice]["LeftShoulderC0"],
- Positions[Choice]["LeftShoulderC1"]
- }
- },
- ["Right Hip"] = {
- ["Limb"] = Character["RLEG"],
- ["C"] = {
- Positions[Choice]["RightHipC0"],
- Positions[Choice]["RightHipC1"]
- }
- },
- ["Left Hip"] = {
- ["Limb"] = Character["LLEG"],
- ["C"] = {
- Positions[Choice]["LeftHipC0"],
- Positions[Choice]["LeftHipC1"]
- }
- },
- }
- end
- local Knocked = function(player)
- local Character = Get_Parts(player)
- Character["Humanoid"].PlatformStand = true
- local Motors = MotorSystem(Character,"Knock")
- for i, v in next, Motors do
- coroutine.resume(coroutine.create(function()
- if Character["Torso"]:FindFirstChild(i) then
- Character["Torso"]:FindFirstChild(i):Destroy()
- Glue(i, Character["Torso"], Motors[i]["Limb"], unpack(Motors[i]['C']))
- Touchy(Motors[i]["Limb"])
- end
- end))
- end
- end
- local GetUp = function(player)
- local Character = Get_Parts(player)
- Character["Humanoid"].PlatformStand = false
- Character["Humanoid"].Jump = true
- local Motors = MotorSystem(Character,"GetUp")
- for i, v in next, Motors do
- coroutine.resume(coroutine.create(function()
- if Character["Torso"]:FindFirstChild(i) then
- Character["Torso"]:FindFirstChild(i):Destroy()
- Motor(i, Character["Torso"], Motors[i]["Limb"], unpack(Motors[i]['C']))
- Motors[i]["Limb"]:FindFirstChild("Touchy"):Destroy()
- end
- end))
- end
- end
- function Knock:Knock(lplayer, tplayer, skill , cooldown)
- local LocalPlayer = lplayer
- local Target = tplayer
- local Backpack = Target.Backpack["Data"]
- local Blocked = Backpack.Block.Value
- local Deflected = Backpack.Deflect.Value
- local Dodged = Backpack.Dodge.Value
- local IsTS = game.Lighting.TS.Value
- local knocked;
- if Deflected then
- repeat
- wait()
- until not game.Lighting.TS.Value
- Knocked(LocalPlayer)
- knocked = LocalPlayer
- elseif Dodged then
- elseif not Deflected then
- repeat
- wait()
- until not game.Lighting.TS.Value
- Knocked(Target)
- knocked = Target
- end
- game:GetService("ReplicatedStorage").Knocked:FireClient(knocked,cooldown)
- Cooldown_M:AddCooldown(knocked,skill,cooldown)
- while wait() do
- if not Cooldown_M:CheckCooldown(knocked, skill) or knocked.Character["Humanoid"].Health < 1 then
- GetUp(knocked)
- print("Knock Cooldown is done")
- break;
- end
- end
- end
- return Knock
Add Comment
Please, Sign In to add comment