Sorry for being vague in the title, don’t really know how to word that, anyway.
I want to make a script that picks a random player. That’s all. I tried other questions like this, but it has one error:
ServerScriptService.Script:3: invalid argument #2 to ‘random’ (interval is empty)
How would I fix this? Heres the script:
local function PickRandom(part)
local players = game:GetService("Players"):GetPlayers()
local ranplr = players[math.random(1,#players)].Character
if ranplr and ranplr.HumanoidRootPart then
print("hi")
end
end
PickRandom()
This is a serverscript inside of ServerScriptService