I used variable plrs >= 2 and the script won't run.
dft = {}
local plrs = #game:GetService('Players'):GetChildren()
function GetPlayers()
local c = game.Players:GetChildren()
for i = 1, #c do
table.insert(dft, c[i].Name)
end
end
if plrs >= 1 then
function Randomize()
GetPlayers()
local d = math.random(1, #dft)
local s = d
local m = Instance.new("Message", game.Workspace)
m.Text = "The random player is ... "..dft[s].."!"
wait(2)
m:Remove()
local rndm = game.Players:FindFirstChild(dft[s])
if (rndm ~= nil) then
local Player = rndm.Character
Player:MoveTo(Vector3.new(6, 13, 49))
end
end
while true do
wait(5)
Randomize()
end

2 comments
Is there any way I can stop the script from repeating? Thanks.
You remove the while loop or set the while condition to something like
while wait(5) and not ranOnce dothen inside the while loop you set ranOnce to true.