I have a very easy and simple money and weapon storage system on my map with persistent save data across multiple sessions which is precisely as I’ve aimed to achieve, but whenever a player leaves the game my verse code crashes effectively ruining the game for everyone still in the game. This is a big problem for my game right now. Reference code below:
‘’'OnPlayerRemoved(PlayerLeft : agent): void = {
if (Agent := agent[PlayerLeft]) {
if (ActualPlayer := PlayerMap[Agent]) {
var TempPlayerMap : [agent]spawners = map{}
for (Key -> Value : PlayerMap) {
if (Key <> Agent) {
set TempPlayerMap = ConcatenateMaps(TempPlayerMap, map{Key => Value})
}
}
set PlayerMap = TempPlayerMap
}
}
}'''
If need be I can share more code surrounding it, but I believe I am missing something necessary to allow players to leave without the verse code crashing.
@WolfyGamingWorld Hi there! When you say the “Verse code crashes”, do you mean that you see a runtime error occur, or something else? If so, could you please provide the ID of the report? (You can see if your island has experienced runtime errors in the Creator Portal, by navigating to the Technical tab). If not, could you describe what you mean by a “crash” and how it manifests? i.e. Does the server crash for everyone in the game?
Could you also provide the island name/ID as well so that we can take a look internally to see if we have any data regarding what you’re experiencing?