Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I get players that have a specific value?

Asked by 5 years ago

So, I have a script where I want to teleport the players to a reserved server but only the ones that have 'Queue' as the value in their Status (Which is in their Player).

This is what I have so far:

local TS = game:GetService("TeleportService")
local Players = game:GetService("Players")

local code = TS:ReserveServer(game.PlaceId)
for i,v in pairs(game.Players:GetChildren())do
    if v:FindFirstChild("Status").Status.Value == "Queue" then

        local players = --(Where I need the code for the specific players.)
        TS:TeleportToPrivateServer(game.PlaceId,code,players)
    end
0
Why does it say if v:FindFirstChild(“Status”).Status.Value == “Queue” then, it should be if v:FindFirstChild(“Status”).Value == “Queue” 123nabilben123 499 — 5y
0
The player has a folder called status and a value inside of that folder called status too kindacoolguy4000 2 — 5y

Answer this question