// Prints spawn messages in console on servers with prop protection. // By RabidToaster // Settings. local checkTime = 10 // Max time to wait for owner information. local colour = false // Use coloured text in console? true -> orange, false -> white. // If they've asked for colour, we use MsgN. local msgFunc = print if colour then msgFunc = MsgN end // Check every second for updates. local check = {} local function Think() for ent, time in pairs(check) do // Check for an owner. local owner = ent:GetNetworkedEntity("Owner", false) if owner then msgFunc(tostring(owner) .. " spawned [" .. (ent:EntIndex() or "???") .. "][" .. (ent:GetClass() or "???") .. "] with model <" .. (ent:GetModel() or "???") .. ">") check[ent] = nil // Too much time has passed, give up. elseif time < CurTime() then check[ent] = nil end end end timer.Create("Spawned", 1, 0, Think) // Add entities to a table on creation. local function OnEntityCreated(ent) check[ent] = CurTime() + checkTime end hook.Add("OnEntityCreated", "Spawned", OnEntityCreated)