Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Player:UserID() returns -1 inside Clientside EntityRemoved hook #6117

Open
Srlion opened this issue Dec 15, 2024 · 0 comments
Open

Player:UserID() returns -1 inside Clientside EntityRemoved hook #6117

Srlion opened this issue Dec 15, 2024 · 0 comments

Comments

@Srlion
Copy link

Srlion commented Dec 15, 2024

Details

Trying to retrieve the user id of a player inside EntityRemoved clientside returns -1, but it works fine on serverisde.

hook.Add("EntityRemoved", "UserID", function(ent, full_update)
    if full_update then return end
    if type(ent) ~= "Player" then return end

    print(ent:IsValid(), ent:UserID(), ent:EntIndex()) -- outputs: true -1 2
end)

Steps to reproduce

  1. Add the hook from above in clientside
  2. Join the server
  3. Spawn a bot
  4. Kick the bot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant