I’m creating a hitbox system and I have a bindable function that returns any characters inside it
when I invoke the function, it doesn’t print anything, return anything nor give an error
test script (caller):
game.Players.PlayerAdded:Once(function(player)
while task.wait(5) do
local result = game:GetService("ReplicatedStorage").GetCharactersInHitbox:Invoke(player.Character:FindFirstChild("HitHitbox", true)
if not result then print("Nope..") else for _, v in result do print(v.Name) end end --no printing..
end
end)
script (child of bindable function):
script.Parent.OnInvoke = function(hitbox)
print("RAN") --doesn't even print this
local params = OverlapParams.new()
params.FilterType = OverlapParams.new()
params.FilterDescendantsInstances = hitbox.Parent:GetChildren()
local parts = workspace:GetPartsInPart(hitbox, params)
print(#parts) --> doesn't print
if not parts[1] then return nil end
local characters = {}
for _, v in parts do
if not v.Parent:FindFirstChild("Humanoid") then continue end
if table.find(characters, v.Parent) then continue end
table.insert(characters, v.Parent)
end
print(#characters) --> doesn't print
if not characters[1] then return nil end
return characters
end