#invite system for 20 coins

1 messages · Page 1 of 1 (latest)

outer topaz
#

how do i make it so when a player invites someone then they will get 20 coins (only if the invited player joins, and they can only get it once)

i already have leaderstats for the coins

#

ill pay robux if someone helps me bru

fluid quiver
#

winson helped you

#

pay him

strange cliff
outer topaz
#

Send 100 Robux pass

outer topaz
#

Lemme see if it works tho when i get back from school

outer topaz
#

it doesnt work

#

whenever i join back after spending the coins it just gives them back

fresh elbow
#

You can invite like this
@outer topaz

local Players = game:GetService("Players")
local SocialService = game:GetService("SocialService")

local player = Players.LocalPlayer

local Button = script.Parent

Button.Activated:Connect(function()
    pcall(function()
        if SocialService:CanSendGameInviteAsync(player) then
            SocialService:PromptGameInvite(player)
        end
    end)
end)

This is localscript inside button btw.
And you just do Player:GetJoinData() on a server code to see how they joined.
After that just do your currency stuff

outer topaz
#

Ik that but idk how to give the coins whenever they invite

pastel reefBOT
#

studio** You are now Level 1! **studio

hexed notch
pastel reefBOT
#

studio** You are now Level 5! **studio

hexed notch
#

@outer topaz

#

take a look at this

outer topaz
#

alright

#

if the leaderstat is called "Coins" would i just change this to coins

hexed notch
#

if findfirstchild is not working try adding a waitforchild like this:

local coin = leaderstats:WaitForChild("Coins")
outer topaz
#

wow thx

#

it works but how do i make it so the player can only do it once