my hit box isnt working i am using fast cast for the projectile movement btw if that helps
------out side function
local rayHitbox = require(game:GetService(“ServerStorage”):WaitForChild(“BaseModules”):WaitForChild(“RaycastHitboxV4”))
local rayParam = RaycastParams.new()
rayParam.FilterType = Enum.RaycastFilterType.Blacklist
----inside function shoot
local cosmeticBullet = game:GetService("ReplicatedStorage"):WaitForChild("Effects").Ranged.Fire.Fireball:Clone()
local hitbox = rayHitbox.new(cosmeticBullet) | |
---|---|
hitbox.RaycastParams = rayParam | |
hitbox.Visualizer = true | |
hitbox:HitStart() |
hitbox.OnHit:Connect(function(hit, Humanoid, result)
cosmeticBullet:Destroy()
print("RayHitbox")
Humanoid:TakeDamage(15)
end)
----connects
–Connects
tool.Equipped:Connect(Equipped)
remote.OnServerEvent:Connect(Shoot)
caster.LengthChanged:Connect(onLengthChanged)
caster.RayHit:Connect(Casthit)