After a player dies they cant swing their sword. I have no idea why, and this issue recently started around a month ago when I had the swords for around a year.
local RMod = require(game.ReplicatedStorage.RegionModule)
local Player = game.Players.LocalPlayer
repeat wait() until Player.Character
local c = Player.Character
local mouse = Player:GetMouse()
local Enabled = true
game.ReplicatedStorage.Sword:FireServer("SetUp")
local UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(input,typing)
if typing then return end
if c:findFirstChild("Sword") and Enabled == true then
if input.KeyCode == Enum.KeyCode.R then
game.ReplicatedStorage.Sword:FireServer("Skill1")
elseif input.KeyCode == Enum.KeyCode.F then
game.ReplicatedStorage.Sword:FireServer("Skill2")
elseif input.KeyCode == Enum.KeyCode.V then
game.ReplicatedStorage.Sword:FireServer("Skill3")
end
end
end)
local Combo = 0
mouse.Button1Down:connect(function()
if c:findFirstChild("Sword") and Enabled == true then
Enabled = false
if Combo == 0 then
Combo = 1
local Track = Instance.new("Animation")
Track.AnimationId = "rbxassetid://6709053351"
local Anim = c.Humanoid:LoadAnimation(Track)
Anim:Play()
local move = Instance.new("BodyPosition")
move.MaxForce = Vector3.new(1,0,1) * 5000
move.Parent = c.HumanoidRootPart
move.Position = c.HumanoidRootPart.CFrame*Vector3.new(0,0,-25)
wait(.2)
move:Destroy()
elseif Combo == 1 then
Combo = 2
local Track = Instance.new("Animation")
Track.AnimationId = "rbxassetid://6709060521"
local Anim = c.Humanoid:LoadAnimation(Track)
Anim:Play()
local move = Instance.new("BodyPosition")
move.MaxForce = Vector3.new(1,0,1) * 5000
move.Parent = c.HumanoidRootPart
move.Position = c.HumanoidRootPart.CFrame*Vector3.new(0,0,-25)
wait(.2)
move:Destroy()
elseif Combo == 2 then
Combo = 3
local Track = Instance.new("Animation")
Track.AnimationId = "rbxassetid://6709042277"
local Anim = c.Humanoid:LoadAnimation(Track)
Anim:Play()
local move = Instance.new("BodyPosition")
move.MaxForce = Vector3.new(1,0,1) * 5000
move.Parent = c.HumanoidRootPart
move.Position = c.HumanoidRootPart.CFrame*Vector3.new(0,0,-25)
wait(.2)
move:Destroy()
else
Combo = 0
wait()
local Track = Instance.new("Animation")
Track.AnimationId = "rbxassetid://6709037008"
local Anim = c.Humanoid:LoadAnimation(Track)
Anim:Play()
local move = Instance.new("BodyPosition")
move.MaxForce = Vector3.new(1,0,1) * 5000
move.Parent = c.HumanoidRootPart
move.Position = c.HumanoidRootPart.CFrame*Vector3.new(0,0,-25)
wait(.2)
move:Destroy()
end
local HB = Instance.new("Part")
local Pos = c.HumanoidRootPart.CFrame*CFrame.new(0,0,-4).p
local Reg = Region3.new(Pos-Vector3.new(2,2,2),Pos+Vector3.new(2,2,2))
HB.Size = Vector3.new(4,2,8)
HB.CFrame = c.HumanoidRootPart.CFrame*CFrame.new(0,0,-4)
local AR = RMod.FromPart(HB)
local RTable = AR.Cast(AR,c)
for i,v in pairs(RTable) do
if v.Name == "HumanoidRootPart" or v.Name == "LeftUpperLeg" or v.Name == "LeftLowerLeg" or v.Name == "RightLowerLeg" or v.Name == "RightUpperLeg" or v.Name == "UpperTorso" and v.Parent:findFirstChild("Humanoid") then
local RTable = workspace:FindPartsInRegion3(Reg, c, 5000)
for i,v in pairs(RTable)do
if v.Name == "HumanoidRootPart" or v.Name == "LeftUpperLeg" or v.Name == "LeftLowerLeg" or v.Name == "RightLowerLeg" or v.Name == "RightUpperLeg" or v.Name == "UpperTorso" and v.Parent:FindFirstChild("Humanoid")then
game.ReplicatedStorage.Sword:FireServer("Slash", v.Parent)
end
end
end
end
wait(.1)
Enabled = true
wait(.1)
end
end)