local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local Tool = script.Parent
local remote = game.ReplicatedStorage.GlobalCombatRemote
local raycastRemote = script.Parent.KatanaServer.raycastEvent
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local rightArm = character:FindFirstChild("Right Arm")
local Combo = 0
local DMG = 5
local extraDMG = 2
local gWait = 0.3 -- General wait
local fWait = 2.5 -- Final wait
local KatanaTrail = Tool.Katana_Model.Trail
local KatanaAnimations = game.ReplicatedStorage.KatanaAnimations
local AttackAttribute = humanoid:FindFirstChild("Attacking")
local EquippedAttribute = humanoid:FindFirstChild("Equipped")
local StunnedAttribute = humanoid:FindFirstChild("Stunned")
local KatanaSequnce = {
KatanaAnimations.K1,
KatanaAnimations.K2,
KatanaAnimations.K3,
KatanaAnimations.K4,
KatanaAnimations.K5
}
local function comboCheck()
if Combo == 0 or Combo > #KatanaSequnce then
return
end
local animation = KatanaSequnce[Combo]
if not animation then
warn("Invalid animation for Combo: " .. Combo)
return
end
local KatanaTrack = humanoid:LoadAnimation(animation)
if not KatanaTrack then
warn("Failed to load animation for Combo: " .. Combo)
return
end
AttackAttribute.Value = true
KatanaTrack:Play()
raycastRemote:FireServer(KatanaTrack.Length) -- Cast Hitbox
KatanaTrail.Enabled = true
wait(KatanaTrack.Length)
AttackAttribute.Value = false
KatanaTrail.Enabled = false
if Combo == #KatanaSequnce then
wait(fWait)
Combo = 0
end
end
Tool.Activated:Connect(function()
if AttackAttribute.Value == false and Tool.Enabled == true and EquippedAttribute.Value == true and StunnedAttribute.Value == false then
Combo += 1;
comboCheck()
print(KatanaSequnce[Combo], "Sequence")
end
end)
Tool.Equipped:Connect(function()
character.Animate.Enabled = false
Tool.KatanaAnimate.Enabled = true
EquippedAttribute.Value = true
remote:FireServer()
end)
Tool.Unequipped:Connect(function()
EquippedAttribute.Value = false
character.Animate.Enabled = true
Tool.KatanaAnimate.Enabled = false
local motor6dDestroy = rightArm:GetDescendants()
for _, obj in ipairs(motor6dDestroy) do
if obj:IsA("Instance") then
obj:Destroy()
end
end
end)
What solutions have you tried so far? Did you look for solutions on the Developer Hub?.
I’ve tried looking but no results replicated my issue not sure what’s causing this. This issue also persisted in a complete new baseplate
What I meant to say is that, you are somehow sharing a tool with 2 players, each player should have their own tool, on the other side, are you using motor6d in the tool?