BakaSchwarz Posted November 20, 2018 Share Posted November 20, 2018 (edited) Hi, at the moment i use the "ms_playerjoined" and "ms_playerleft" events to call my function whenever someone leaves or joins the game: inst:ListenForEvent("ms_playerjoined", eventfn, GLOBAL.TheWorld) inst:ListenForEvent("ms_playerleft", eventfn, GLOBAL.TheWorld) "inst" in this case is an icebox standing anywhere in the world/caves. The problem i have is that these aren't the right events i think... because ms_playerleft gets only called when someone leaves the caves or logs out from the caves. If the player joined in the overworld and never goes underground, neither event gets called. I need an event that fires when a player logs in and that i can catch regardless if the player joins in the overworld or caves and a similar event for a leaving player. Is there anything i can use? As a temporary fix i use periodic tasks to check for players, but this is pretty bad for performance considering i only care when a player joins or leaves. Edited November 20, 2018 by BakaSchwarz Link to comment https://forums.kleientertainment.com/forums/topic/99224-call-function-whenever-a-player-joinsleaves/ Share on other sites More sharing options...
GCC.1st Posted December 2, 2018 Share Posted December 2, 2018 (edited) ms_playerspawn and ms_playerdespawn, may be, I'm not so sure Edited December 2, 2018 by GCC.1st Link to comment https://forums.kleientertainment.com/forums/topic/99224-call-function-whenever-a-player-joinsleaves/#findComment-1125293 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now