RaycastHitbox V4 Missing method "HitStart"

Hello. I’m trying to make a sword with the raycast hitbox plugin. but when i use “HitStart” it outputs an error that says Players.marciofrfr.Backpack.LinkedSword.SwordScript:44: attempt to call missing method 'HitStart' of table - Server - SwordScript:44. Which is confusing, because “HitStart” is clearly a valid method. Sometimes it also says “HitStop” isnt a valid method. Here is the full code of the sword:

local tool = script.Parent
local anim = script.Equip
local hold = script.Hold
local SND = script.Sound
local SlashSND = tool.Handle.Slash
local Trail = tool.Handle.Trail
local Idle = nil

local RS = game:GetService("ReplicatedStorage")
local ComboAnims = RS:WaitForChild("CommonAnims"):FindFirstChild("Combo")
local Slash = ComboAnims.Slash1

local RayHit = require(RS.RaycastHitboxV4)

local Hitbox = RayHit.new(tool.Hit)

tool.Equipped:Connect(function()
	local Char = tool.Parent
	local Hum = Char:WaitForChild("Humanoid")
	local Animator = Hum.Animator
	
	local EquipAnimClip = Animator:LoadAnimation(anim)
	EquipAnimClip:Play()
	SND:Play()
	
	EquipAnimClip.Stopped:Wait()
	local HoldAnimClip = Animator:LoadAnimation(hold)
	HoldAnimClip:Play()
	Idle = HoldAnimClip
end)

tool.Unequipped:Connect(function()
	Idle:Stop()
end)

tool.Activated:Connect(function()
	local Char = tool.Parent
	local Hum = Char:WaitForChild("Humanoid")
	local Animator = Hum.Animator
	
	if Hum:GetAttribute("Attacking") == true then return end
	if Hum:GetAttribute("Blocking") == true then return end
	
	Hitbox:HitStart()
	
	Idle:Stop()
	
	Hum:SetAttribute("Attacking", true)
	
	Hum.WalkSpeed = 15
	
	Trail.Enabled = true
	
	SlashSND:Stop()
	SlashSND:Play()
	
	local SlashClip = Animator:LoadAnimation(Slash)
	SlashClip:Play()
	
	SlashClip.Stopped:Wait()
	
	Hitbox:HitStop()
	
	Trail.Enabled = false
	
	Hum:SetAttribute("Attacking", false)
	Idle:Play()
	
	Hum.WalkSpeed = 25
end)

Video Footage:

I tried moving the “HitStart” method to the start, where i define the hitbox, but then the red lines of the raycast, simply dont appear. I dont know if i should post script support for a module, but i really need help!

I fixed it! The all i had to do was change local Hitbox = RayHit.new(tool.Hit) to local Hitbox = RayHit.new(tool). The red lines still werent showing up, but i just moved the damage points from a part called “Hit” i made, to the handle, and then they showed up.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.