![]() |
onPlayerLeaves on clientside?
Obviously the onPlayerLeaves() function is not accessible on clientside, so is there some way to replicate this on the clientside? I created a GUI on the clientside in a class and want a way to remove it when the player leaves the level. Any ideas?
|
Use onPlayerEnters() instead. It fires when a player enters a level, so basically when the previous one is left. Check for/save the level name if you need more accurate checks.
|
That's possible, but it wouldn't be able to [easily] kill the GUI and would have to be put in every single level, considering the player could potentially reach any level after having the class' GUI activated in the level it stands in.
The class creates a button on the screen, so it's not like it can simply be closed out of, and like I stated previously, if onPlayerEnters() were to be used, it would have to be placed in every level and would make it far more difficult to destroy the GUI after the player leaves said level. |
onPlayerEnters() is not restricted to level NPCs. Put it in a weapon, or wherever your button is being created.
|
Hm, ok so I can just define onPlayerEnters() and exclude the level it's being created in? Interesting, thanks! Sorry, didn't think about that!
|
All times are GMT +2. The time now is 01:53 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.