So, I’m following this tutorial from 2020 on how to make a gun for my game and I came across this issue I can’t figure out…
script.Parent.Fire.OnServerEvent:Connect(function(player, mousePos)
local raycastParams = RaycastParams.new()
raycastParams.FilterDescendantsInstances = (player.Character) -- Where the problem is
raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
local raycastResult = workspace:Raycast(script.Parent.Handle.Position,(mousePos - script.Parent.Handle.Position)*300,RaycastParams)
if raycastResult then
local hitPart = raycastResult.Instance
local model = hitPart:FindFirstAncestorOfClass("Model")
if model:FindFirstChild("Humanoid") then
model.Humanoid.Health -= 30
end
end
end)
That’s the current code I’m using, I’d really appreciate it if someone could figure it out.
Thanks,
– Luke

thanks!