Here Is My Code Plz Help
local Player = game.Players:GetChildren() local Random123 = math.random(1, #Player) local hint = Instance.new("Hint") hint.text = Random123.."Has Been Chosen"
this is the error
bad argument #2 to 'random' (interval is empty)
What that means is that Player
is an empty Table.
You should only run this code if there is at least one player in the game, and optimally if there are two or more:
while game.Players.NumPlayers < 2 do game.Players.PlayerAdded:wait() end local Player = game.Players:GetPlayers() --The prefered method for getting all Players. local Random123 = Player[math.random(#Player)] --No need to use a `1` there, it's automatically filled, and you never actually got the specific player chosen, only their index within the table. local hint = Instance.new("Hint", workspace) -- Gotta parent it! hint.Text = Random123.Name .. " Has Been Chosen" --There needs to be a space before `has` or this will look weird.