Can't detect an id from a table

Hey! Recently, I tried to make an admin system, And when i want to detect my id of roblox, Nothing happens, Here is my code.

local Players = game:GetService("Players")
local AdminIDs = {"1165324570"}

Players.PlayerAdded:Connect(function(player)
	if table.find(AdminIDs, player.UserId) then
		print("Admin joined.")
	end
end)

Any help is apreciated!

Turn the table into an integer.

local Players = game:GetService("Players")
local AdminIDs = {1165324570} -- Turned into an integer

Players.PlayerAdded:Connect(function(player)
	if table.find(AdminIDs, player.UserId) then
		print("Admin joined.")
	end
end)

Thank you so much, I tried for like 20 minutes.

No problem, remember that integers and strings are completely different things.

You can convert between these two with the following functions.

tostring(number) -- Converts number to string
tonumber(string) -- Converts string to number
1 Like

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