#Invite players reward
1 messages · Page 1 of 1 (latest)
local HttpService = game:GetService("HttpService")
local SocialService = game:GetService("SocialService")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local data = {
senderUserID = player.UserId,
spawnLocation = {12, 48, 205.5}
}
local launchData = HttpService:JSONEncode(data)
-- Construct invite options with launch data
local inviteOptions = Instance.new("ExperienceInviteOptions")
inviteOptions.LaunchData = launchData
-- Function to check whether the player can send an invite
local function canSendGameInvite(sendingPlayer)
local success, canSend = pcall(function()
return SocialService:CanSendGameInviteAsync(sendingPlayer)
end)
return success and canSend
end
local canInvite = canSendGameInvite(player)
if canInvite then
SocialService:PromptGameInvite(player, inviteOptions)
end
scroll down a bit
Bro I know how invite script works but I want that when a invited player joins you get rewarded with currency
bro go read what i sent
Alr