Party Service [v2.1] - create a party system more easily

Introduction

What Is?
party service is an open-source module that facilitates the creation of party systems, it is very simple to use

Why Use It?

  • easy to create party systems
  • frequently updated
  • FREE
  • send data between places
  • documentation
  • idk, it’s cool! i guess
  • open-source

Get the Model
Roblox | GitHub | a random site i published it | Documentation

How to Use

first get the model or use the module id to get updates automatically

local PartyService = require(game.ReplicatedStorage.PartyService)

or

local PartyService = require(9771730581)

if you want to create a party you can use:

PartyService:Create(Player, PlaceId, PartyName, MaxPlayers)
-- Owner: the party owner/party leader, it doesn't matter
-- PlaceId: the place id of the place the players will be teleported to
-- PartyName (optional): a string that can be used to display to other players, if nil it will be set to "[OwnerName]`s Party"
-- MaxPlayers (optional): self explanatory, the module does not add more players if the limit is already reached. if it is 0 or nil the limit will be set to 50

if you want to delete a party use:

PartyService:Delete(Party)
-- Party: the table that is returned from PartyService:Create()

if you want to add a player to a party use:

PartyService:AddPlayer(Player, Party)
-- Player: the player to be added
-- Party: the table that is returned from PartyService:Create()

if you want to remove a player from a party use:

PartyService:RemovePlayer(Player, Party)
-- Player: the player to be removed
-- Party: the table that is returned from PartyService:Create()

if you want to kick a player from a party use:

PartyService:KickPlayer(Player, Party)
-- Player: the player to be kicked
-- Party: the table that is returned from PartyService:Create()

if you want to start a party use:

PartyService:StartParty(Party)
-- Party: the table that is returned from PartyService:Create()

if you want to teleport players back from a game use:

PartyService:TeleportToLobby(LobbyId, PlayersTable)
-- LobbyId: the place id of the lobby the players will be teleported to
-- PlayersTable: a table with the instance of the players to be teleported

if you want to test a game started from a party in studio use:

PartyService:SetPartyServerEmulator(FakeData)
-- FakeData: a test data that the place would receive from a party

if you want to save a data to be read later when the party starts use:

Party:SetAsync(Data)
-- Data: data to be sent

Some example codes
a simple script that creates parties when the player enters the game (on the lobby place):

local PartyService = require(game.ReplicatedStorage.PartyService) -- requires de module

game.Players.PlayerAdded:Connect(function(plr) -- when a player enters the game
	local NewParty = PartyService:Create(plr, PlaceId, "cool party", 4) -- creates a new party
	plr.PlayerGui.Gui.StartButton.MouseButton1Click:Connect(function() -- when start button is pressed
		PartyService:StartParty(NewParty) -- starts the party
	end)
end)

a simple script that detects when the game started by a party and places the selected map in workspace:

local PartyService = require(game.ReplicatedStorage.PartyService)
local LobbyPlaceId = 12345678 -- lobby place id

local FakeData = { -- for testing reasons
	["Map"] = "TestMap", -- a test map you have or a random map you have
	["Inventories"] = {
		["CavaleiroDev"] = "TestSword", -- your name and a test sword or a random sword you have
	}
}

PartyService:SetPartyServerEmulator(FakeData) -- now the game will recognize when you test in roblox studio

PartyService.ServerStarted:Connect(function(PartyData, PartyInfo) -- put here the code to start the game
	local Map = game.ReplicatedStorage:FindFirstChild(PartyData["Map"]) -- gets the map data in the table
	if Map then
		Map:Clone().Parent = workspace
	else
		warn("error: no map selected")
		PartyService:TeleportToLobby(LobbyPlaceId , game.Players:GetChildren())
	end
	for PlayerName, Weapon in pairs(PartyData["Inventories"]) do  -- gets the players inventory data in the table
		local WeaponModel = game.ReplicatedStorage.Weapons:FindFirstChild(Weapon)
		local player = game.Players:FindFirstChild(PlayerName)
		if WeaponModel then
			if player then
				WeaponModel:Clone().Parent = player.Backpack
			end
		end
	end
end)

Update logs

Info
thanks for reading this far

I hope this module has helped you, if you want the model you can get it here . If you have any questions or find a bug please feel free to comment below.

oh and thank you so much for the 100 sales :partying_face::partying_face::partying_face:.

126 Likes

hmm pretty useful ngl, ill use it sooner or later.

5 Likes

Seem pretty good might use, Good work!

2 Likes

Update: it is now possible to view the parameters of a function

if you are using the module download the new version here and replace the module that is in your place

Before:

After

2 Likes

Party Service v2
hello developers, today I bring a new version for the party service, with it we have tons of new features that should improve your party system

:pager: Party Invite Code
now we have this new feature where parties by default will have a random invite code, you can use this code in the second parameter like this: PartyService:AddPlayer(player, "xxxx-xxx") but of course you can still use a PartyTable in the second parameter

Q: can i change how the code is generated?
R: of course, just access the new “Settings” module and change the “InviteFormat” value to a string using the following formats:

%l = random lower letter
%L = random upper letter
%a = random lower or upper letter
%n = random number
%r = random lower digit
%R = random upper digit
%x = random lower or upper digit

that way you can generate codes the way you want

code examples

"%l%l%l%l-%n%n%n" = zbdp-546
"%n%n%n%n%n" = 75037
"CODE_%n%n%n" = CODE_647
"%x%x%x%x" = f174 or lg1F or 951e
```"%a%a%l%l%L%L_%n"`` = XtbdYM_3

you can also modify the values within the “Letters” and “Numbers” tables to control which digits the system can use when generating the code

Q:I don’t think this system matches my game, is there a way to disable it?
R: Yes, you can set “InviteCodeEnabled” value to false inside settings

:repeat: Send Data Between Places
in my opinion this is one of the best features of the module, now you can finally send data through places using the module

but how do i use it?
after creating a party you can use the new party function Party:SetAsync()

an example code of how this works:

local PartyService = require(game.ReplicatedStorage.PartyService)

local PartyData = { -- example data
	["Map"] = "Castle",
	["Inventories"] = {
		["Player1"] = "Sword",
		["Player2"] = "Bow",
	}
}
local Party = PartyService:Create(Owner, 12345) -- creates a party
Party:SetAsync(PartyData) -- sets a data to a party

simple right?

OK BUT HOW I GONNA GET MY DATA, HELP ME PLS

using the “ServerStarted” event that is activated when the server was started by a party, here is an example code:

local PartyService = require(game.ReplicatedStorage.PartyService)
local LobbyPlaceId = 12345678 -- lobby place id

PartyService:SetPartyServerEmulator()

PartyService.ServerStarted:Connect(function(PartyData, PartyInfo) -- put here the code to start the game
	local Map = game.ReplicatedStorage:FindFirstChild(PartyData["Map"]) -- gets the map data in the table
	if Map then
		Map:Clone().Parent = workspace
	else
		warn("error: no map selected")
		PartyService:TeleportToLobby(LobbyPlaceId , game.Players:GetChildren())
	end
	for PlayerName, Weapon in pairs(PartyData["Inventories"]) do  -- gets the players inventory data in the table
		local WeaponModel = game.ReplicatedStorage.Weapons:FindFirstChild(Weapon)
		local player = game.Players:FindFirstChild(PlayerName)
		if WeaponModel then
			if player then
				WeaponModel:Clone().Parent = player.Backpack
			end
		end
	end
end)

I pressed play and it says nil in PartyData, why? someone help me

what happened is that when you test through roblox studio there is no way for the game to know the data you sent, because you didn’t send anything. so you have to put a fake data in the PartyService:SetPartyServerEmulator() parameter. a functional code would look like this:

local PartyService = require(game.ReplicatedStorage.PartyService)
local LobbyPlaceId = 12345678 -- lobby place id

local FakeData = { -- for testing reasons
	["Map"] = "TestMap", -- a test map you have or a random map you have
	["Inventories"] = {
		["CavaleiroDev"] = "TestSword", -- your name and a test sword or a random sword you have
	}
}

PartyService:SetPartyServerEmulator(FakeData) -- now the game will recognize when you test in roblox studio

PartyService.ServerStarted:Connect(function(PartyData, PartyInfo) -- put here the code to start the game
	local Map = game.ReplicatedStorage:FindFirstChild(PartyData["Map"]) -- gets the map data in the table
	if Map then
		Map:Clone().Parent = workspace
	else
		warn("error: no map selected")
		PartyService:TeleportToLobby(LobbyPlaceId , game.Players:GetChildren())
	end
	for PlayerName, Weapon in pairs(PartyData["Inventories"]) do  -- gets the players inventory data in the table
		local WeaponModel = game.ReplicatedStorage.Weapons:FindFirstChild(Weapon)
		local player = game.Players:FindFirstChild(PlayerName)
		if WeaponModel then
			if player then
				WeaponModel:Clone().Parent = player.Backpack
			end
		end
	end
end)

cool!
but what if I want to get the party data in another script or without using this event?

that’s why this functions were created:

PartyService:GetCurrentPartyData() which returns the current party data
PartyService:GetCurrentPartyInfo() which returns current party information (like party name, id, etc)

Q: but is it safe to use this data? could some exploiter falsify them?
R: as the module is in beta sometimes you can end up not receiving the data you sent (this never happened to me but I’m not sure). and about exploiters: no, they cannot modify this information on the server as they use the DataStoreService to share it between servers

:rotating_light: Very Important Changes :rotating_light:
some functions and events had their names changed here is a list of them:

  • PartyService.PartyServerStarted event whas renamed to PartyService.ServerStarted

  • PartyService:GetPartys() function was renamed to PartyService:GetParties()

change these names in case you wanted to change to v2 version

:lady_beetle: Bugs

  • fixed a bug where :RemovePlayer() did not remove the player, please update your module to fix this bug

:large_blue_diamond: Feedback & Info

thanks for reading this far

I hope this update has helped you, if you want the model you can get it here. and consider voting below for feedback on this update. If you have any questions or find a bug please feel free to comment below. oh and thank you so much for the 100 sales :partying_face::partying_face::partying_face:.

how was this update?

  • Good (what was added will be useful)
  • Normal (nothing that was added will be useful, but cool)
  • Bad (this update harmed me more than it helped)

0 voters

see you later

12 Likes

Party Service v2.1
hello developers, today I bring a new small version for the party service

:no_entry: Outdated Warning
from now on the module uses the HttpService to check your update and let you know. but as not everyone likes to have their outputs full of warning, specifically when you are looking for a bug, there is an option in the settings that disables this

Deactivating the outdated warning:
open the module called “Settings” and change “settings.WarnOutdated” to false

Limitations
this only works if the game has the “HttpEnabled” option, otherwise it won’t warn nothing

:pager: GetPartyPlayerIsIn() function
a new function created by @keirahela [github] (I swore this had already been implemented)

PartyService:GetPartyPlayerIsIn(Player) -- returns: Party
-- Player: player instance

:lady_beetle: Bugs

  • fixed a bug where infinite players could join a party with the maximum number of players set to 0, will now be set to 50 (the maximum number of players that can be teleported using TeleportService)
  • now players cannot join a party while in another party
  • fixed a bug where players were able to create a party while in another party
  • now the second parameter of the PartyService.ServerStarted event and the returned value of PartyService.GetPartyInfo should correctly return the player ids

:page_with_curl: New Post
this time I decided to be ashamed of myself and improve this post on devforum, I’m also improving the page on github little by little so keep an eye out

:large_blue_diamond: Feedback & Info

thanks for reading this far

I hope this update has helped you, if you want the model you can get it here. If you have any questions or find a bug please feel free to comment below

how was this update?
I won’t do that since this update is too small

see you later

9 Likes

Im sorry, could you make a youtube tutorial?

1 Like

Like what i mean in more detail is a tutorial on how we should code it how we should make the ui and all of that. I think i understand the system so i can do it but i know others might want or need a video

1 Like

Alright I have a question about the system, is it possible to change the max number of players? Because I want to make it 4 not 50. What i mean is it automatically sets to 50 if it is nil. How I am making it is there is a configuration folder inside of the create party gui thing i made that has values when you press the create button it sends those values over to the create party thing so i think i can just make that value 4 automatically that might work but if not how could I change that setting?

Thanks

1 Like

Is it possible to make a function that will get all of the current parties and display them on the likes of a playergui, that way you can then join whatever party you want from a lobby?

4 Likes

Yeah this would be a great feature!

1 Like

just change the value of the fourth parameter of PartyService:Create() to 4

1 Like

you can use a for loop using PartyService:GetParties() function and display the information in a player gui

I will improve the “tutorials” we have now, they don’t really teach

There is an error when using function PartyService:Delete(Party) and I changed the code.
You have to change line490. which is table.remove(Players, PlayerToRemove) to table.remove(Players, FindPlayer).

1 Like

What does it mean to start a party? Is it diffrent from creating a party?

1 Like

Wow, such a amazing resource. If I had this earlier it would be a lifesaver.

Tysm for this, I will definitely use this in the future.

1 Like

yes, it teleports all the players in the party to another place

oh, how did i let this one? anyway, i already made the change and now this problem is fixed

1 Like

Got some idea, add a queu for matchmaking would be cool :thinking: