Hello Everyone. I’m currently making a script that gives you a badge if you leave and rejoin a game, you will get a badge. Here is what I have so far.
I added a RemoteEvent under ReplicatedStorage
I renamed the RemoteEvent to LeaveRejoinEvent
local LeaveRejoinEvent = game.ReplicatedStorage.LeaveRejoinEvent
local BadgeService = game:GetService("BadgeService")
local BadgeId = 0 --Insert your BadgeId here
I don’t know what else to do.
Any help will be appreciated!
You could store the player’s userid into a datastore if there is no data about the player yet and then when the player joins and the data is set to something new then they will be awarded a badge. Then you can set that data to something else so it wont try giving you another badge again.
Like @alliedoeihoialt mentioned, you could save data that they were there. Depending on your use case you could use either MemoryStoreService or DataStoreService. Personally I’d utilize memory store service, as it would be more reliable. If you want to store it long-term though, use data store service.
If you are just now learning it, I’d recommend looking at these articles, as data stores and by association, memory stores can be difficult to learn at first. If done improperly, you can end up having data loss.