And track, if the friend they invite, actually comes into the game, and if so reward them… when someone click on invite, are you able to tell / track who the user name is that they invited?
otherwise you could just spam invite to get rewards…
Not just track friend joins, but you can also tell when someone is directly followed into a game (which includes when someone accepts a game invite). I implanted a system like this a while ago in an old game of mine to announce “X has joined you directly” in chat, which will show up regardless if they’re friended or not.
A simple reward flow for user invites could just be:
Track when someone (P1) “invites” someone else (P2) (You can’t truly track invites, but if a custom UI is used you can make some assumptions like if P2 is clicked on a custom list, because it isn’t 100% guaranteed that they invited make sure this data does expire, you should store this data on P2, the referral should also NOT get stored if P2 has played before)
If P2 joins the game before the expiry date and has never played before, reward them and/or P1. (depending on how you want it set up)
-- P2 DataStore (pref. scope)
{
hasPlayed: false, -- if this is true, referral should be nil
referral: {
userId: 1, -- UserID of P1
expiry: 0, -- ms since epoch of invite
}
}