So I have a huge issue, I’m trying to make it so when the player leaves the game, a bool value saves. BUT no matter what I tried, the script won’t detect the player leaving nor events being able to tell it to do something.
What I’ve tried: make another server script send an event to the script in the PlayerGui when a player leaves, letting the server script detect when a player leaves, and detecting when the player leaves by parent. None work
How would I fix this???
game.Players.PlayerRemoving:Connect(function(player)
print("recieved")
local userid = player.UserId
local Data = keep.Value
local success, errormessage = pcall(function()
KeepData:SetAsync(userid, Data)
end)
end)
I don’t wanna change the saving system to be done in ServerScriptService as moving all of it/changing all the systems would take to long so is there another way to do this???