I am attempting to use a remote function to determine whether a hitbox is touched.
remote.OnServerInvoke = function(plr, action)
if action == 1 then
Debris:AddItem(hitbox, 0.2)
hitbox.Touched:Connect(function(part)
if part.Parent:FindFirstChild(“Humanoid”) then
return true
end
end)
else if action == 2 then
Debris:AddItem(hitbox, 0.2)
hitbox.Touched:Connect(function(part)
if part.Parent:FindFirstChild(“Humanoid”) then
return true
end
end)
end
delay(0.2, function()
return false
end)
end
When I set a variable to the call
local callback = remote:InvokeServer(action)
print(callback)
callback is always nil
I saw another post that mentioned scope, but I wasn’t sure how this applied to my problem, as there is always a path to a return statement.
Thanks in advance.