I can’t tell whether i am doing something stupid, but my raycast just, doesn’t raycast.
local function DealDamage()
local RANGE = meleeInfo[tool.Name]["RANGE"] -- This is a number, something like 5 for example
-- Raycast parameters;
local origin = player.Character.HumanoidRootPart
local raycastParams = RaycastParams.new()
raycastParams.FilterDescendantsInstances = {player.Character}
raycastParams.FilterType = Enum.RaycastFilterType.Exclude
local hitReg = workspace:Raycast(origin.Position, direction * RANGE, raycastParams)
SwingSound:Play()
SwingSound.PlaybackSpeed = 1
stamina.Value -= COMBO_STAMINA_CONSUMPTION
player.Regenerating.Value = false
-- Check if any buffs are active;
if player:GetAttribute("Berserk") then
COMBO_DAMAGE = COMBO_DAMAGE * 2
end
if hitReg then
print("Found something lol") -- doesn't print :(
local character = hitReg.Instance.Parent
if character:FindFirstChild("Humanoid") and not Players:GetPlayerFromCharacter(character) then
local humanoid = character.Humanoid
humanoid:TakeDamage(COMBO_DAMAGE)
DamageIndicatorEvent:FireClient(player, COMBO_DAMAGE, character)
CheckForKill(humanoid)
end
end
end