LabAPI icon indicating copy to clipboard operation
LabAPI copied to clipboard

[BUG]: Player.Host is null when the Plugin is enabled

Open hatulaile opened this issue 1 year ago • 3 comments

Before You Report

  • [x] I have searched for existing reports of this bug, and this bug report is unique.

Version

1.1.4

Description

Player.Host is null when the Plugin is enabled When enabled, creating examples requires the use of host.

To Reproduce

Detect the value of Player.Host when enabled

Expected Behavior

No response

Additional Information

I'm not sure if this counts as a bug. Perhaps there are other ways to obtain the Host?

hatulaile avatar Nov 30 '25 05:11 hatulaile

You mean in your plugins Plugin::Enable method? I think the network server just hasn't loaded yet. You could move you logic into SeverEvent -> Waiting for players probably.

OMEGA3065 avatar Nov 30 '25 05:11 OMEGA3065

As Omega has mentioned, the server hasn't fully started yet when plugins are enabled. The facility has to be loaded for the host to be created. Use the WaitingForPlayers event, when the host is guaranteed to be not null.

Axwabo avatar Nov 30 '25 06:11 Axwabo

Thank you both.

hatulaile avatar Nov 30 '25 07:11 hatulaile