Unable to cast Array to int64?

So I have this script and I don’t know how to make it work I am getting an error line 5??

local Group = {12502892}
local AdminGui = game.ServerStorage.AdminPanel

	game.Players.PlayerAdded:Connect(function(Player, NewPlayer)
	local IsAdmin = table.find(Group, Player:GetRankInGroup(Group))--table.find(AdminIds, NewPlayer.UserId) ~= nil -- Is their user id in the admin list?
	if IsAdmin >= 253 then -- Were they an admin? If so...
		local NewAdminGui = AdminGui:Clone()
		NewAdminGui.Parent = NewPlayer.PlayerGui -- Give them the gui
		end
end)

game.ReplicatedStorage.AdminRemote.OnServerEvent:Connect(function(Player, Command, Arguments)
	local IsAdmin = table.find(Group, Player:GetRankInGroup(Group))
	if IsAdmin >= 253 then -- A player called the remote - are they an admin? If so...
		-- Execute admin commands
	else -- However, if the player wasn't an admin...
		Player:Kick("You're not an admin.") -- Or however you want to handle a non-admin calling the remote (which wouldn't be possible without the gui)
	end
end)

and also how do I make my admin commands run through this?

I don’t see where the table.find() comes in useful on line 5. I would suggest just testing it without the table.fine() and see what happens.

1 Like

Ill try that one min
limitttttt

I still got the same error limit


here is the image of the code and the error

Remove the NewPlayer parameter and try.

1 Like

Remove the brackets in the Group variable and leave the numbers as they are.

1 Like

Also, don’t put this in a table. Just type group number.

1 Like

I need the new player parameter for


removing the brackets fixed one error but now I got another

Oh okay, but just change the group from {} to just a number.

1 Like

I did do that and that fixed one error but now I got another I sent pic in the post 2 posts above

Why are there 2 arguments in the function?
The Player and the NewPlayer if I am correct are the same thing, so just change the NewPlayer to Player and remove the NewPlayer from the function args.

1 Like

Trying that rn I’ll update this post with the results FIXED IT TYSM @DeveloperBLK

2 Likes

Rq one more thing how do I make commands run through that script from my gui so it runs through the server? Say for example a kick command I want it to go to the server to verify you are the one running it

I want it to run here

Are you calling the commands through a gui, message or textbox?

1 Like

So what I was planing on is having a admin gui with a text box for entering username and buttons for the commands kick ban etc then when I hit it it runs through the server script to verify you are a admin running it.

Just copy and paste the same thing you did as when you checked for the Admin when they joined

1 Like

No but how do I make commands run through it