I have a script where there are four string values in a queue and each has the name of a player in game. Every time i run it, it says Unable to cast value to object. Anyone know any way to fix it?
1 | for i,v in pairs (queue 1 ) do |
2 | local plr = game.Players:WaitForChild(v.Name) |
3 |
4 | TS:TeleportToPrivateServer( 3350448651 ,code,plr) |
on the wiki it says the 3rd argument is an array of players so maybe you should do this
1 | local plrs = { } |
2 | for i,v in pairs (queue 1 ) do |
3 | local plr = game.Players:WaitForChild(v.Name) |
4 | players:insert(plr) |
5 |
6 | end |
7 | TS:TeleportToPrivateServer( 3350448651 ,code,plrs) |