My Hitbox isn’t moving to the right limb, There is no errors, nothing, I’ve tried discord, youtube, google. Nothing.
Here is the script:
local rp = game:GetService("ReplicatedStorage")
local combat = rp:WaitForChild("Combat")
local Debris = game:GetService("Debris")
local Animations = script:WaitForChild("AnimationFolder")
local Meshes = script:WaitForChild("Meshes")
local anims =
{
Animations:WaitForChild("Right"),
Animations:WaitForChild("Kick"),
Animations:WaitForChild("Gut")
}
local limbs =
{
"RightHand",
"RightHand",
"RightFoot",
}
local Damage = 5
combat.OnServerEvent:Connect(function(player, count)
local Character = player.Character
local Hum = Character:WaitForChild("Humanoid")
local attack = Hum:LoadAnimation(anims[count])
attack:Play()
local Limb = Character:WaitForChild(limbs[count])
local Folder = Instance.new("Folder")
Folder.Name = player.Name.." Melle"
local Hitbox = Meshes:WaitForChild("HitBox"):Clone()
Hitbox.CFrame = Limb.CFrame
Hitbox.Parent = Folder
Debris:AddItem(Hitbox, 0.5)
local Weld = Instance.new("ManualWeld")
Weld.Part0 = Hitbox
Weld.Part1 = Limb
Weld.C0 = Weld.Part0.CFrame:toObjectSpace(Weld.Part1.CFrame)
Weld.C1 = Weld.Part1.CFrame:toObjectSpace(Weld.Part0.CFrame)
Weld.Parent = Weld.Part0
Hitbox.Touched:Connect(function(Hit)
if Hit:IsA("BasePart") then
if not Hit:IsDescendantOf(Character) then
local enemyHumanoid = Hit.Parent:FindFirstChild("Humanoid")
if enemyHumanoid then
Hitbox:Destroy()
enemyHumanoid:TakeDamage(Damage)
end
end
end
end)
combat:FireClient(player)
end)
–X