See if a players friend joined the same game/server?

Hello, I’m currently trying to make a reward system by inviting friends. You’ll earn said reward IF that friend or any friend joins the game. I’m assuming it has to due with DataStores as I want there to be a wait for how long until you can get the reward again. Basically one friend joins, both get the reward, then both have to wait before receiving it again. I have an invite system set up but it’s the checking of if a friend joined the game. I’m just not sure how to check if the player joined or not.
TL;DR: Check if a friend joined the game, both get a reward, both now need to wait x amount of time.
I would provide script(s) but I’m stumped and couldn’t find any info on what I’m looking for.
Any help is appreciated, thanks in advanced,

Could’ve just searched for API regarding player joining and anything to do with friends. PlayerAdded and IsFriendsWith. FollowUserId if you want to check if a player joined the game by following someone else instead of just joining and getting auto matchmade into a friend’s server. To add a reward limit, make use of os.time and search up examples of its use in DataStores to create reward time limits or the like.

1 Like