Attempt to call missing method 'GetChildren' of table

BE.TPPlayers.Event:Connect(function()
	local players = Players:GetPlayers()
	for i, v in pairs(players:GetChildren()) do -- Error Here
		if v:FindFirstChild("Values") then
			if v.Values.InSubway.Value == true then
				-- Teleport Players that have this value set to true
			else
				-- Don't Teleport Players that have this value set to false
			end	
		end
	end	
end)

I want to be able to teleport players only if the InSubway.Value is set to true.
If it’s not true then they wont be teleported.

This is a server script. Does it need to be local?

Any help is appreciated!

2 Likes

players is a table, and you don’t need to use :GetChildren() on it.

for i, v in pairs(players) do

4 Likes

Oh I didn’t know that!

This works perfectly now, thanks!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.