Hey! I’m trying to use swordphin’s raycast hitbox module to make a hitbox for my tool. I made sure to put attachments on the blade of the sword to indicate where the raycasts should be. However, I keep getting the same error: “Attempting to call a nil value.” What should I do??? Here is my script.
local Sword = script.Parent.Parent
local Event = Sword.RemoteEvent
local RaycastingModule = require(game.ReplicatedStorage.RaycastHitbox)
Event.OnServerEvent:Connect(function(Player, Action)
local c = Player.Character
if Action == "Slash1" then
local Hitbox = RaycastingModule.new(script.Parent)
Hitbox:HitStart()
Hitbox.OnHit:Connect(function(hit, humanoid)
print(hit)
humanoid:TakeDamage(50)
end)
Hitbox:HitStart()
end
end)
The error is on this line:
local Hitbox = RaycastingModule.new(script.Parent)
What should I do???