You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When networking the newWeapon on the hook PlayerSwitchWeapon to the client, it can occur, when the hook only runs the serverside, the weapon does not get networked properly making the weapon nil.
That makes no proper hook for initializing stuff on weapons, besides on overriding hooks, like WEAPON:INITIALIZE.
Steps to reproduce
Run the hook.
Network weapon.
The text was updated successfully, but these errors were encountered:
This is due to the weapon being seen late by the client. To my knowledge, this is core engine behaviour and can be worked-around by either waiting in a timer for the weapon to be valid, or initialize in the deploy method if the weapon has not done so yet (which is what I do in my base).
Details
When networking the newWeapon on the hook PlayerSwitchWeapon to the client, it can occur, when the hook only runs the serverside, the weapon does not get networked properly making the weapon nil.
That makes no proper hook for initializing stuff on weapons, besides on overriding hooks, like WEAPON:INITIALIZE.
Steps to reproduce
Run the hook.
Network weapon.
The text was updated successfully, but these errors were encountered: