It has come to my attention that users can exploit a lot of trading systems in most games by using hacks to allow themselves to play the same game in two different servers whilst on the same account.
This is a known issue that does happen and can cause a lot of games to go downhill when it comes to their economy.
So how do we fix this? Well the new messaging service makes it very easy to solve this issue!
Simply use the code in ServerScriptService for this place:
local PlayerSessions = {} --Creates a place to store the GUIDs for each user
game.Players.PlayerAdded:Connect(function(plr)
local connection
connection = game:GetService("MessagingService"):SubscribeAsync(plr.UserId,function(dat)--We create a subscription for the user checking for any new calls to the function
if dat.Data ~= PlayerSessions[plr.UserId].ID then--This ignores your own player in the same server
plr:Kick("Found the same player in another server!")
connection:Disconnect()--We disconnect the event from the function so we don't get rate limited
game:GetService("MessagingService"):PublishAsync(plr.UserId,PlayerSessions[plr.UserId].ID)--This sends out a publish async to the subscription we just created. In this case if there were two servers with the same user, the subscription on both servers would kick both users. It really acts as a call back to the original server for confirmation
PlayerSessions[plr.UserId] = nil--we don't want extra garbage in the table
end
end)
PlayerSessions[plr.UserId] = {
ID = game:GetService("HttpService"):GenerateGUID(false);--This makes a temporary unique id for the client
Connection = connection;--This stores the connection for your player in this server incase they leave
}
game:GetService("MessagingService"):PublishAsync(plr.UserId,PlayerSessions[plr.UserId].ID)--This sends the initial check to see if there are two or more clients
end)
game.Players.PlayerRemoving:Connect(function(plr)
PlayerSessions[plr.UserId].Connection:Disconnect()--See this disconnects that connection we made in the playeradded function
PlayerSessions[plr.UserId] = nil
end)
Here’s how this works, when your player joins a server, the game puts your user into a table inside the script with a generated GUID. The server then sends out a publish async with the key being your userid. We do this because we also set up a subscription on your userid so if there’s two separate servers with the same player and the GUID doesn’t match then it’ll kick both players instantly.
You can get the same result doing this with datastores as well. Also the guid generation has a very low chance of creating the same id so I wouldn’t worry.
No disrespect intended, but what exactly is the point of managing players like this?
From what I remember, Roblox doesn’t allow the same user to have multiple clients running at the same time regarding of the device(s) they’re running Roblox on.
That’ what I’ve been able to find, it’s also easy to execute that but it shouldn’t be a problem, if you design your Economy well enough these things shouldn’t effect it
You can find more with a Google search and the Link I’ve provided.
But in short;
You can run 3 Roblox Instances on 1 PC,
Using the normal Roblox Client , the Roblox thing from Windows 10 store and Bluestacks
With 3 accounts of course, and this doesn’t account for using a Virtual Machine so technically you can have an infinite number of Instances depending on your Computer’s Spec and Internet
This is a really unnecessarily thread as you’ve completely misunderstood what is possible with applications that allow you to run multiple instances of the Roblox client. They do in fact allow you to have multiple accounts open on the computer. But thats as far as their scope goes.
I can assure you players cannot;
Connect the same account to the same game
Connect the same account to different games
And also in response to @RuizuKun_Dev, these methods are the easiest people have access to in which you listed however there is a free application which I wont advertise by name that allows you to run multiple of the standard Roblox clients. No need for Windows Store, VMs, nothing.
What I do is way different. Say a player owns a pet right. I store pets as a table like so,
-- Pet data example
{
uniqueID = game:GetService("HttpService"):GenerateGUID(false); -- This is only ran once when it's being added to their DataStore
petName = "Doggo"; -- Default pet name
customPetName = "Charley"; -- Custom pet name set by players
-- etc.
}
Next, say this pet is added to trade right? Typically I use Object-Oriented Programming for trading, so I check through both of the players offers table and see if the unique ids are the same. If it detects that this unique id is already in the trade then I don’t allow this item to be added to the players’ offer table and what I usually do is remove all other pets with that same id and keep only 1.
A couple months ago I recall it was possible to have the same account in two games at once. Don’t know if it’s the case anymore. If you use placelauncher to reserve a ticket for a game and then join another. That already reserved signed ticket can be used without kicking you in the one you just joined by normal means.