Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Keeps saying unable to cast value to object?

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?

	for i,v in pairs(queue1) do
			local plr = game.Players:WaitForChild(v.Name)

TS:TeleportToPrivateServer(3350448651,code,plr)

1 answer

✓ Accepted answer

on the wiki it says the 3rd argument is an array of players so maybe you should do this

	local plrs={}
    for i,v in pairs(queue1) do
            local plr = game.Players:WaitForChild(v.Name)
		players:insert(plr)

end
TS:TeleportToPrivateServer(3350448651,code,plrs)

This discussion is preserved as it was. New answers, comments, and votes are closed.