Help making obby checkpoints

Hmm, well it is a server script, not a local script so I’m just gonna try to think of the solution brb

1 Like

Okay. if it helps, I can give you editor access.

Alright, I’ll look for the issue whenever you give me editor access.

1 Like

Ok. Should I add you to the group and then change your role to developer?
The link to the group is here: Galaxy Studios Roblox Official - Roblox. Feel free to leave it after, or stay if you want.

I guess. Do you have Team Create enabled on your game? If not, then you can change my role to Developer on your group.

1 Like

I do, I didn’t know that you could do team create on a group game

Okay, I added you. I’m pretty sure I can only make you a player though because you aren’t in the group

It’s because I’m not on your friends list :sweat_smile:

Ok, sorry! Should I add you to mu friends list or to the group owners friends list?

I think the group owners friend list? If it doesn’t work then you can add me.

1 Like

Okay, I sent a request on the group holder account

It still says the same thing, maybe just join the group

Alright!

I gotta go :sweat_smile:

I’ll do it when I’m back, okay?

1 Like

Just respond when you fix it (or try to fix it)

instead of game:BindToClose change it to game.BindToClose

It still doesn’t work. Thanks for the help though, because i’m sure that is still a problem

1 Like

Hi there, by the time the game is closing there will be no players left in the server, this is the same case for player removing but there you get a reference for the player. Here’s how to get a player object in game:BindToClose()
Step 1. Have a variable for the last player to leave the game

local lastplayer = nil

Step 2. Assign the last player to leave the game to this variable. Ex:

game.Players.PlayerRemoving:Connect(function(player)
	lastplayer = player
        local data = {player.leaderstats.Stage.Value}
	players_checkpoints:SetAsync(player.UserId, data)
end)

Step 3: use this lastplayer object in bindtoclose

game:BindToClose(function()
	local data = {lastplayer.leaderstats.Stage.Value}
	players_checkpoints:SetAsync(lastplayer.UserId, data)
end)
1 Like

Yes, that’s right, Do not worry about the question being dumb. We all have been begginers at some point

2 Likes

It is game:BindToClose though.