Hello people and developers!
(There are probably a lot of solutions, but I actually read and couldn’t find anything wrong with my code)
I have a custom hitbox, and when using :GetPartsInPart(), it does not work at all. Nothing gets returned. Here is the sniplet which you need most likely:
ExecutionRemote:FireClient(Player)
local OP = OverlapParams.new()
OP.FilterType = Enum.RaycastFilterType.Exclude
OP.FilterDescendantsInstances = {Character}
local Hits = workspace:GetPartsInPart(LaunchHitBox, OP)
local Potential = {}
print(Hits, "Hits")
for i, v in pairs(Hits) do
local PCharacter = v.Parent
if PCharacter:IsA("Model") then
local PHumanoid = PCharacter:FindFirstChild("Humanoid")
if PHumanoid and PHumanoid:IsA("Humanoid") then
print(PCharacter)
if Potential[PCharacter] == nil then
Potential[PCharacter] = PCharacter
end
end
end
end
This is how it gets called:
--Mover and Launch
local MoveThread = coroutine.create(function()
task.wait(RS_Settings.Server.LaunchDuration)
StopLaunch()
coroutine.yield()
end)
coroutine.resume(MoveThread)
--Touched and Stop Thread
local TConnection = nil
TConnection = LaunchHitBox.Touched:Connect(function(Part)
local PCharacter = Part.Parent
if PCharacter:IsA("Model") then
local PHumanoid = PCharacter:FindFirstChild("Humanoid")
if PHumanoid and PHumanoid:IsA("Humanoid") then
TConnection:Disconnect()
coroutine.close(MoveThread)
StopLaunch()
end
end
end)
Now here are the print statements:
Clearly its not returning anything. If I remove the OverlapParams, it returns my own character
Here is ingame picture btw: ITS CLEARLY HITTING
Thanks for stopping by!