Skip to content

PartyService:AddPlayer()

CavaleiroDev edited this page Nov 7, 2022 · 1 revision

adds a player to a specific party

Info

PartyService:AddPlayer(Player, Party)

Parameter Value Required What is Default
Player Instance (Player) True the player to be added to the party
Party PartyTable or String True a valid PartyTable or a valid invite code string

Sample code

local PartyService = require(game.ReplicatedStorage.PartyService)
local event = game.ReplicatedStorage.AddPlayer

event.OnServerEvent:Connect(function(localplayer, Player, Id)
	local Party = PartyService:GetPartyById(Id)
	if Party then
		PartyService:AddPlayer(Player, Party)
	end
end)

Returns

Value What it does
Boolean true if the operation was successful, otherwise false
String a success or error message

Clone this wiki locally