Closed legokidlogan closed 2 months ago
The error you posted indicates that the chip owner was invalid and the script tried to use timer.simple which requires an owner for the timer limit to be checked. It doesn't have anything to do with the timer in the hook call itself.
The chip errored on another player's client, not the owner. I've encountered this at least 30 or so different times now, none of which errored on the owner's client. In all cases, the owner's client instance was perfectly fine.
Furthermore, in all cases both the owner and the player who got the error had been fully spawned into the server for a long time, with the error occurring long after the chip was fully loaded by all clients. Whenever the error occurs, it only happens to one seemingly random player, never multiple at the same time.
Ive had this happen so many time too, sometime the owner player become invalid for some reason to some clients
The chip errored on another player's client, not the owner. I've encountered this at least 30 or so different times now, none of which errored on the owner's client. In all cases, the owner's client instance was perfectly fine.
Furthermore, in all cases both the owner and the player who got the error had been fully spawned into the server for a long time, with the error occurring long after the chip was fully loaded by all clients. Whenever the error occurs, it only happens to one seemingly random player, never multiple at the same time.
I never said the error happened on the owner; just the error indicates that the owner entity went invalid. You'll have to add checks to your code to check that the owner is valid maybe. If the chip tries to use the owner to increment a limit counter and the owner is invalid, it'll error.
https://github.com/thegrb93/StarfallEx/blob/master/lua/starfall/libs_sh/timer.lua#L78 timer.simple() doesn't use the chip owner for the limit, it uses the local player.
Nevermind, sf stores the owner as instance.player
Totally not confusing at all.
Either way, there shouldn't be anything that makes instance.player
become invalid in that hook. This issue only started happening recently, sometime around when changes were made to handling full updates and OnRemoved.
I've been getting this error lately too, but it doesn't even come with a stack traceback for me. It's definitely something that started happening more recently. I can't figure out how to reproduce the issue on purpose, but I don't think it's something that can be reliably solved by isValid() checks on the user's part. It just happens.
I wonder if the IsValid() refactor is the cause.
I'll check if the subclass metas get their own IsValid functions or not.
Been getting those error where player.instance become invalid for about a month
Could see if https://github.com/thegrb93/StarfallEx/pull/1823 fixes it. Idk if the gmod devs have some weird jank where calling the method this way instead of directly would have different behavior.
If not, then I think a gmod update caused the change in behavior of players going invalid.
I'm not merging that btw till it's confirmed to help. Someone needs to check it out.
I think this can be closed now that the error networking is better. If you still find something is wrong feel free to open another.
timer.simple()
inside of theOnEntityCreated
hook in the client realm will sometimes error on other players with "Invalid starfall user"