Im trying to make a crowbar similar to half life, but the tool seems to damage me despite my raycast params
I Tried adding a check for the player but that was pointless, and I also tried looking at some forum posts but none of them seemed to help.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local raycastParams = RaycastParams.new()
raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
-- blacklist is essentially the same thing as ignore list
raycastParams.FilterDescendantsInstances = {char,tool}
tool.Activated:Connect(function()
if debounce == false then
debounce = true
Animation2:Play()
local Rayc = workspace:Raycast(workspace.CurrentCamera.CFrame.Position, workspace.CurrentCamera.CFrame.LookVector * 4, raycastParams)
if Rayc then
local Hit = Rayc.Instance
script.Parent.RemoteEvent:FireServer(Hit)
print(Hit)
end
wait(.3)
debounce = false
end
end)
Edit: I realize it would be useful if you had an example, so here:
https://gyazo.com/ad30cd151e875240037a9c45c72c385f