*** What are you attempting to achieve? (Keep it simple and clear)**
Choose a random character and get the name of the character.
*** What is the issue? (Keep it simple and clear - Include screenshots/videos/GIFs if possible)**
I get this error: [attempt to get length of global ‘playerJoiningGameFolder’ (a userdata value)]
solutions have you tried so far? (Have you searched for solutions through the Roblox Wiki yet?)
Tried a lot of different ways of getting a random character.
Hi, basically I have a folder with players that want to join a game. And I want to get a random character from that folder so I can teleport the player. Somehow it doesnt work, I think it might be something with that I want to make a character a variable…
Here is the script:
(more, but not important stuff)
playerJoiningGameFolder = workspace.PlayersJoiningGame
function chooseRandomPlayerFromList()
local randomPlayer = math.random(1,#playerJoiningGameFolder) --error here
return randomPlayer
end
full error: Workspace.VotingSystemServer.RoundChooserMainScriptServer:317: attempt to get length of global ‘playerJoiningGameFolder’ (a userdata value)]
thank for any help!