Issue with textbox?

Do you have any idea how I will be able to ensure the player who fired the remote is on the admin list and how to make it secure then?

The text of a textbox is local. It can not be accessed through a normal script. That is why remote events are needed for admin guis.

1 Like

You could use a table to check if a player is whitelisted to fire the event.

For example:

local AdminTable = {
“topcst”
}

if table.find(AdminTable, tostring(Player.Name)) then

Create a module, with all of the Admin ids in.

Check if that player’s ID Is in that module, if it is - Allow the user to kick the player, else don’t.
(or use a table in the script, either one works)

Yes you can use a table to achieve this, loop around a table that has the names of the adminlist usernames, and use the table.find function to check if they’re on the list.

you can use a table of admins like this:

local admins = {"topcst"}
Event.OnServerEvent:Connect(function(plr)
    if table.find(admins, plr.Name) then
        --code for admins
    end
end)

You can also use it with UserIds, which can be the safest way.

Exactly like this would be perfect, although - Be sure to get the player’s ID Rather than there username, as there ID Will always be the same unlike there username.

local admins = {
	1,
	250,
	1000
}

Event.OnServerEvent:Connect(function(plr)
    if table.find(admins, plr.Name) then
        --code for admins
    end
end)

(Code which Sniper wrote for you) ^

Or you could do it like this, both do the same task.

local admins = {
	1, -- UserID's here
}

Event.OnServerEvent:Connect(function(Player)
	local UserID = game.Players[Player.Name].UserId
	if admins[UserID] then
		--code for admins
	end
end)

As @S1RKnighty mentioned, you can’t use server scripts on the client, you must use remote objects to communicate between the client and the server.

1 Like

TextBoxes have been changed so they only change on the PlayerGui; weird change by roblox, but if you can refer to the PlayerGui and find the textbox as a child to it; it should have the updated text.

What would you mean with weird change by roblox? I believe this is what Filtering enabled was introduced for?

Please correct me if I sound wrong.

Well; they’ve kept it usually the same for a while, but I’m guessing they changed it to PlayerGui to prevent the game from getting filtered. It was a weird change for me as it broke many scripts without notice. Odd move by roblox, but understandable.

(Also, the TextBox.Text now has to be found via PlayerGui.)

I don’t think PlayerGui stuff was ever supposed to Replicate to the server since FE was forced on all games.

You should probably read more about what Filtering Enabled was forced for, because for me it doesn’t seem like a Odd move.

Also you can obviously pass in TextBox.Text property through the RemoteEvent, and filter it on server and use it. So why you need to reference the PlayerGui directly?

I don’t know, it just doesn’t update the text in the StarterGui. Also, we are moving a bit away from the topic.