How do I make a command that joins any player?

Hey! So I was trying to figure out how moderators would be able to join a hackers game to prove they are hacking because I plan on using external games for the player to join a match. How would I make a command to join a random player?

local TS = game:GetService("TeleportService")
local data = {TS:GetPlayerPlaceInstanceAsync(hackerid)}
--assuming you already have the player defined (the admin)
TS:TeleportToPlaceInstance(data[3], data[4], plr)

firstly, you need to put in a table of admins plus you have to define the prefix and the command to join
it isn’t that easy

I had assumed you already had that stuff down. You shouldn’t ask people to make whole systems for you; you are supposed to provide solutions you have tried and we will provide answers to questions/help you debug your code and find problems. Here are some barebones you can use:

local admins = {1}

function handle(plr)
    if table.find(admins, plr.UserId) then
            --handle the message

for i,v in pairs(game.Players:GetPlayers()) do handle(v) end

thank you that helped me a lot

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.