server script
local cd = {}
game.ReplicatedStorage.RemoteEvents.RollEvent.OnServerEvent:Connect(function(plr, rolltype)
if not table.find(cd, plr.Name) then
table.insert(cd, plr.Name)
cd[plr.Name] = false
end
if cd[plr.Name] == true then return end
if plr.Character.Status:FindFirstChild("Stun") then return end
if plr.Character.Status:FindFirstChild("M1") then return end
if plr.Character.Status:FindFirstChild("Parry") then return end
if plr.Character.Status:FindFirstChild("Roll") then return end
cd[plr.Name] = true
local char = plr.Character
local humanoid = char.Humanoid
humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false)
if plr.Character.Status:FindFirstChild("Blocking") then
plr.Character.Status.Blocking:Destroy()
for i, v in pairs(plr.Character.Humanoid:FindFirstChild("Animator"):GetPlayingAnimationTracks()) do
if v.Name == "VigilSwordBlock" then
v:Stop()
humanoid.WalkSpeed = 16
end
end
end
if rolltype == "Left" then
-----------------------------------------------------
local anim = game.ReplicatedStorage.Animations.LeftRoll
local animloaded = humanoid:FindFirstChild("Animator"):LoadAnimation(anim)
--animloaded:Play()
local rollf = Instance.new("Folder", plr.Character.Status)
rollf.Name = "Roll"
local a = Instance.new("Attachment", char.HumanoidRootPart)
a.Name = "A0"
a.Orientation = Vector3.new(0, 0, 0)
local lv = Instance.new("LinearVelocity", plr.Character.HumanoidRootPart)
lv.MaxForce = 100000
lv.RelativeTo = "Attachment0"
lv.Attachment0 = char.HumanoidRootPart.A0
lv.VelocityConstraintMode = Enum.VelocityConstraintMode.Line
lv.LineDirection = Vector3.new(1, 0, 0)
lv.LineVelocity = -45
char.Humanoid.JumpPower = 0
char.Humanoid.WalkSpeed = 0
if char.Status:FindFirstChild("Sprinting") then
char.Status.Sprinting:Destroy()
end
local connect
connect = char.Status.ChildRemoved:Connect(function(instance)
if instance.Name == "Roll" then
local anim2 = game.ReplicatedStorage.Animations.RollCancel
local animloaded2 = humanoid:FindFirstChild("Animator"):LoadAnimation(anim2)
animloaded2:Play()
if plr.Character.HumanoidRootPart:FindFirstChild("LinearVelocity") then
plr.Character.HumanoidRootPart.LinearVelocity:Destroy()
end
if plr.Character.HumanoidRootPart:FindFirstChild("A0") then
plr.Character.HumanoidRootPart.A0:Destroy()
end
local rcf = Instance.new("Folder", plr.Character.Status)
rcf.Name = "RollCancel"
game.Debris:AddItem(rcf, 0.25)
local rcif = Instance.new("Folder", plr.Character.Status)
rcif.Name = "RCiFrames"
game.Debris:AddItem(rcif, 0.25)
char.Humanoid.JumpPower = 50
char.Humanoid.WalkSpeed = plr.Stats.BaseWalkspeed.Value
connect:Disconnect()
end
end)
task.wait(0.04)
local rollif = Instance.new("Folder", plr.Character.Status)
rollif.Name = "RiFrames"
task.wait(0.24)
connect:Disconnect()
if plr.Character.Status:FindFirstChild("RiFrames") then
plr.Character.Status.RiFrames:Destroy()
end
if plr.Character.Status:FindFirstChild("Roll") then
plr.Character.Status.Roll:Destroy()
end
if plr.Character.HumanoidRootPart:FindFirstChild("LinearVelocity") then
plr.Character.HumanoidRootPart.LinearVelocity:Destroy()
end
if plr.Character.HumanoidRootPart:FindFirstChild("A0") then
plr.Character.HumanoidRootPart.A0:Destroy()
end
char.Humanoid.JumpPower = 50
char.Humanoid.WalkSpeed = plr.Stats.BaseWalkspeed.Value
elseif rolltype == "Right" then
-----------------------------------------------------
local anim = game.ReplicatedStorage.Animations.LeftRoll
local animloaded = humanoid:FindFirstChild("Animator"):LoadAnimation(anim)
--animloaded:Play()
local rollf = Instance.new("Folder", plr.Character.Status)
rollf.Name = "Roll"
local a = Instance.new("Attachment", char.HumanoidRootPart)
a.Name = "A0"
a.Orientation = Vector3.new(0, 0, 0)
local lv = Instance.new("LinearVelocity", plr.Character.HumanoidRootPart)
lv.MaxForce = 100000
lv.RelativeTo = "Attachment0"
lv.Attachment0 = char.HumanoidRootPart.A0
lv.VelocityConstraintMode = Enum.VelocityConstraintMode.Line
lv.LineDirection = Vector3.new(1, 0, 0)
lv.LineVelocity = 45
char.Humanoid.JumpPower = 0
char.Humanoid.WalkSpeed = 0
if char.Status:FindFirstChild("Sprinting") then
char.Status.Sprinting:Destroy()
end
local connect
connect = char.Status.ChildRemoved:Connect(function(instance)
if instance.Name == "Roll" then
local anim2 = game.ReplicatedStorage.Animations.RollCancel
local animloaded2 = humanoid:FindFirstChild("Animator"):LoadAnimation(anim2)
animloaded2:Play()
if plr.Character.HumanoidRootPart:FindFirstChild("LinearVelocity") then
plr.Character.HumanoidRootPart.LinearVelocity:Destroy()
end
if plr.Character.HumanoidRootPart:FindFirstChild("A0") then
plr.Character.HumanoidRootPart.A0:Destroy()
end
local rcf = Instance.new("Folder", plr.Character.Status)
rcf.Name = "RollCancel"
game.Debris:AddItem(rcf, 0.25)
local rcif = Instance.new("Folder", plr.Character.Status)
rcif.Name = "RCiFrames"
game.Debris:AddItem(rcif, 0.25)
char.Humanoid.JumpPower = 50
char.Humanoid.WalkSpeed = plr.Stats.BaseWalkspeed.Value
connect:Disconnect()
end
end)
task.wait(0.04)
local rollif = Instance.new("Folder", plr.Character.Status)
rollif.Name = "RiFrames"
task.wait(0.24)
connect:Disconnect()
if plr.Character.Status:FindFirstChild("RiFrames") then
plr.Character.Status.RiFrames:Destroy()
end
if plr.Character.Status:FindFirstChild("Roll") then
plr.Character.Status.Roll:Destroy()
end
if plr.Character.HumanoidRootPart:FindFirstChild("LinearVelocity") then
plr.Character.HumanoidRootPart.LinearVelocity:Destroy()
end
if plr.Character.HumanoidRootPart:FindFirstChild("A0") then
plr.Character.HumanoidRootPart.A0:Destroy()
end
char.Humanoid.JumpPower = 50
char.Humanoid.WalkSpeed = plr.Stats.BaseWalkspeed.Value
elseif rolltype == "Foward" then
-----------------------------------------------------
local anim = game.ReplicatedStorage.Animations.LeftRoll
local animloaded = humanoid:FindFirstChild("Animator"):LoadAnimation(anim)
--animloaded:Play()
local rollf = Instance.new("Folder", plr.Character.Status)
rollf.Name = "Roll"
local a = Instance.new("Attachment", char.HumanoidRootPart)
a.Name = "A0"
a.Orientation = Vector3.new(0, -90, 0)
local lv = Instance.new("LinearVelocity", plr.Character.HumanoidRootPart)
lv.MaxForce = 100000
lv.RelativeTo = "Attachment0"
lv.Attachment0 = char.HumanoidRootPart.A0
lv.VelocityConstraintMode = Enum.VelocityConstraintMode.Line
lv.LineDirection = Vector3.new(1, 0, 0)
lv.LineVelocity = -45
char.Humanoid.JumpPower = 0
char.Humanoid.WalkSpeed = 0
if char.Status:FindFirstChild("Sprinting") then
char.Status.Sprinting:Destroy()
end
local connect
connect = char.Status.ChildRemoved:Connect(function(instance)
if instance.Name == "Roll" then
local anim2 = game.ReplicatedStorage.Animations.RollCancel
local animloaded2 = humanoid:FindFirstChild("Animator"):LoadAnimation(anim2)
animloaded2:Play()
if plr.Character.HumanoidRootPart:FindFirstChild("LinearVelocity") then
plr.Character.HumanoidRootPart.LinearVelocity:Destroy()
end
if plr.Character.HumanoidRootPart:FindFirstChild("A0") then
plr.Character.HumanoidRootPart.A0:Destroy()
end
local rcf = Instance.new("Folder", plr.Character.Status)
rcf.Name = "RollCancel"
game.Debris:AddItem(rcf, 0.25)
local rcif = Instance.new("Folder", plr.Character.Status)
rcif.Name = "RCiFrames"
game.Debris:AddItem(rcif, 0.25)
char.Humanoid.JumpPower = 50
char.Humanoid.WalkSpeed = plr.Stats.BaseWalkspeed.Value
connect:Disconnect()
end
end)
task.wait(0.04)
local rollif = Instance.new("Folder", plr.Character.Status)
rollif.Name = "RiFrames"
task.wait(0.24)
connect:Disconnect()
if plr.Character.Status:FindFirstChild("RiFrames") then
plr.Character.Status.RiFrames:Destroy()
end
if plr.Character.Status:FindFirstChild("Roll") then
plr.Character.Status.Roll:Destroy()
end
if plr.Character.HumanoidRootPart:FindFirstChild("LinearVelocity") then
plr.Character.HumanoidRootPart.LinearVelocity:Destroy()
end
if plr.Character.HumanoidRootPart:FindFirstChild("A0") then
plr.Character.HumanoidRootPart.A0:Destroy()
end
char.Humanoid.JumpPower = 50
char.Humanoid.WalkSpeed = plr.Stats.BaseWalkspeed.Value
elseif rolltype == "Back" then
-----------------------------------------------------
local anim = game.ReplicatedStorage.Animations.LeftRoll
local animloaded = humanoid:FindFirstChild("Animator"):LoadAnimation(anim)
--animloaded:Play()
local rollf = Instance.new("Folder", plr.Character.Status)
rollf.Name = "Roll"
local a = Instance.new("Attachment", char.HumanoidRootPart)
a.Name = "A0"
a.Orientation = Vector3.new(0, -90, 0)
local lv = Instance.new("LinearVelocity", plr.Character.HumanoidRootPart)
lv.MaxForce = 100000
lv.RelativeTo = "Attachment0"
lv.Attachment0 = char.HumanoidRootPart.A0
lv.VelocityConstraintMode = Enum.VelocityConstraintMode.Line
lv.LineDirection = Vector3.new(1, 0, 0)
lv.LineVelocity = 45
char.Humanoid.JumpPower = 0
char.Humanoid.WalkSpeed = 0
if char.Status:FindFirstChild("Sprinting") then
char.Status.Sprinting:Destroy()
end
local connect
connect = char.Status.ChildRemoved:Connect(function(instance)
if instance.Name == "Roll" then
local anim2 = game.ReplicatedStorage.Animations.RollCancel
local animloaded2 = humanoid:FindFirstChild("Animator"):LoadAnimation(anim2)
animloaded2:Play()
if plr.Character.HumanoidRootPart:FindFirstChild("LinearVelocity") then
plr.Character.HumanoidRootPart.LinearVelocity:Destroy()
end
if plr.Character.HumanoidRootPart:FindFirstChild("A0") then
plr.Character.HumanoidRootPart.A0:Destroy()
end
local rcf = Instance.new("Folder", plr.Character.Status)
rcf.Name = "RollCancel"
game.Debris:AddItem(rcf, 0.25)
local rcif = Instance.new("Folder", plr.Character.Status)
rcif.Name = "RCiFrames"
game.Debris:AddItem(rcif, 0.25)
char.Humanoid.JumpPower = 50
char.Humanoid.WalkSpeed = plr.Stats.BaseWalkspeed.Value
connect:Disconnect()
end
end)
task.wait(0.04)
local rollif = Instance.new("Folder", plr.Character.Status)
rollif.Name = "RiFrames"
task.wait(0.24)
connect:Disconnect()
if plr.Character.Status:FindFirstChild("RiFrames") then
plr.Character.Status.RiFrames:Destroy()
end
if plr.Character.Status:FindFirstChild("Roll") then
plr.Character.Status.Roll:Destroy()
end
if plr.Character.HumanoidRootPart:FindFirstChild("LinearVelocity") then
plr.Character.HumanoidRootPart.LinearVelocity:Destroy()
end
if plr.Character.HumanoidRootPart:FindFirstChild("A0") then
plr.Character.HumanoidRootPart.A0:Destroy()
end
char.Humanoid.JumpPower = 50
char.Humanoid.WalkSpeed = plr.Stats.BaseWalkspeed.Value
end
task.wait(1.8)
cd[plr.Name] = false
end)