Give rewards to player if invite was successful

Hi! So, I want to make an invite friends button in which the player should get a rewards only if the invite works, meaning the player that they invited joined the game by clicking the play button sent through the invite. Is that even possible? All videos I’ve seen show how to give rewards if the player sent the invite, not if the invite worked. PS: I’ve checked and double checked, it is not against the ToS to give a reward for inviting friends.

Any help would be appreciated! Thank you!

SocialService.GameInvitePromptClosed (roblox.com) this is what i belive your looking for :smile:

1 Like

Thank you! This will run only if it works right? Meaning only if the friend that the player invited joined. I don’t want to give a reward just for sending the invite, only if it works. Also, is it possible to provide an example code for this as this is my first time using the SocialService and I have no clue how to make it work. Thanks!

then you will have to get that player the person invited and use the PlayerAdded Event to check if that player joined

1 Like

Thank you! This is actually what I had in mind. When a player invites a friend, it stores the friend’s name in a folder and using playerAdded, checks whether the player is in that folder or not. My only problem to this is how to check the name of the friend that the player invited. An example, I clicked the invite button and invited my friend Random. How would the script check that the name of the person I invited is Random or something else? Is there a function for that? Thanks!

do you mean get the name of player invited and joined?

1 Like

Yes, that exactly. Like if I invited one of my friends, how would the server know which friend I invited?

cant you use player.name of the player that joined after checking if the player that joined is the invited?

No that’s not what I meant. For this system to work, it will need to take the name of the player that I invited, store it in a folder, and then check for it. My issue is with the first bit, taking the name of the player I invited. Since I’m new to the social service, I’m having some troubles with that.

i am pretty new to heck i haven’t even used it heres where you can learn them basics Invite Friends Button! Tutorial (Roblox Studio SocialService) - YouTube i am sorry i think thats how mjch i can help

2 Likes

Thank you! It’s fine if you didn’t understand (it was probably an issue in my questions) but thank you for trying!

2 Likes

Hey! Did you actually get this working? Additionally, are you sure it’s not against TOS? Apparently someone named Coolbulls got a warning from roblox on his game “Pet Ranch Simulator” for awarding coins to people who spammed invites.

Hey, Im trying to do the same thing, have you found a way?