If you are worried about datastores costing, roblox provides them for free. Every key inside a datastore has a 4MB limit though, although you can create an indefinite amount of them.
Private servers can be joined through an invite link (which dont require the player to be friends) unless you are talking about a custom private server system.
That’s the thing this is a game with sub places if you try to join a private server and then go to a sub place inside that private server you’ll be put inside a public server unless you use the reserve server function. This whole conversation is basically about how to make a system that allows you to join a private server and then a sub place that friends can join and acts like a private server for that game mode without using datastores. And also is there an alternative to reserved servers because of the issue creating to many of them because they aren’t gonna be saved in a datastore.
You said creating many Reserved servers is not bad and that you can have a inf amount I believe you said. That’s one thing answered
Second is basically saying how to give that reserved server code to only friends when they join the game which I thought of using messaging service for.
The main question was is there a way I can make a system where people can make there own private servers in sub places that only friends can join without having to use datastores and is making to many reserved servers that are not longer in use after everyone leaves is bad
I still don’t get why you are avoiding datastores, could you provide me an insight on that, there is nothing wrong about managing multiple datastores. If you are worried about the mess, you can split your script into modules.
As I stated private servers on roblox can be joined through invite links which dont guarantee that they are a friend.
Unfortunately your requests isn’t possible, this primary comes from the fact that you have to “store” the reserved server access code, imagine this:
Player A joins the reserved server and leaves the private server, the private server has shut down. Player B later joins the private server and attempts to join Player A but since there isn’t a stored reserved server access code it can’t know which server to join, this is because if you PublishAsync through messagingservice it has to be received somewhere however it can be received by multiple listeners instead of the server Player A is in. Now ofcourse, this can be fixed using various methods such as checking the players name to see if it matches that friend but as I am stating again not all players inside a private server are required to be the owners friends if they are invited through a link.
You have to use Datastores for this, unfortunately.
That’s actually how I want it to be done
Player A join private server then goes into a reserved server Player B Can join that server if they are friends with the player but once Player A leaves that server is no longer accessible to anyone forever is it bad to do that ? like just forget about it and next time the Player A does the same thing it’s a different reserved server created.
Thats the goal. Which I think I got answer for
Basically my idea is to create a reserved server that shares its join code using messaging service to online friends once that server no longer has anyone it closes down and no longer used. Basically how a horror game does it or how The game islands does it I believe but on a much much larger scale.
If you insist on avoiding datastores even though it is the easiest option for your current request, you can use something like this:
Private server script:
local MessagingService = game:GetService("MessagingService")
-- whenever they are joining:
local subplace_id = 13491394139 -- place id for the subplace
local player_name = player.Name
MessagingService:SubscribeAsync(`response_{subplace_id}`, function(callback)
local data = callback.Data
local code = data.reserved_code
if data.player_name == player_name then
-- your teleport script
end
end)
MessagingService:PublishAsync(`request_{subplace_id}`, {pname = player_name, friendName = friend_name}) -- send the player name and friend name they are joining
Subplace script:
MessagingService:SubscribeAsync(`request_{subplace_id}`, function(callback)
local data = callback.Data
local userId = game.Players:GetUserIdFromNameAsync(data.friendName)
local player = game.Players:GetPlayerByUserId(userId)
if player then
MessagingService:PublishAsync(`response_{subplace_id}` , {reserved_code = reserved_code, player_name = data.player_name})
end
end)
I suggest sending teleport data to the reserved server since it can’t directly access the reserved server code.
thanks for the help. Kk so what I plan on doing is basically using the messaging service along with TeleportService like you said to achieve the desired effect.
I’ll use what you sent as a base for the main system
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.