Help with blacklisting

Im trying to make a blacklist that prevents certain players from being to click on a button, i have though about making it not visible and then having a second layer of a button behind it thats gray which the user cannot click, but the most important thing is to make the button not visible to certain players.

Here is my layout of the button .

I have tried multiple things but i just couldnt get it work, so if someone helps me out, i would be really glad :).

To deactivate the Button, just turn Active and Visible to false. Make a PlayerAdded function on the server and check if the specifiq plr is in the blacklist datastore. If yes, then fire a remote event to the client to turn active and visible on the UIs to false.

Oh, I need to do it using a remote event?

-- This is a server script. Place it in game.ServerScriptService

-- fill this table with user ids of players you want to blacklist
local blacklistedIds = {}

-- When a new player joins
game.Players.PlayerAdded:Connect(function()
    if table.find(blacklistedIds,player.UserId) then
        -- Destroy the button to hide it from view
        local playerGui = player.PlayerGui or player.PlayerGui:Wait()
        playerGui.ScreenGui.Frame.ScrollingFrame.Frame.aviation:Destroy()
    end
end)

-- If this errors, just try using :Wait() on various elements in line 11 until it works
1 Like

You could also use like Kristina PlayerGui but handling UIs via the Server isnt good practice

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