I need help with script

I wants to make

If someone clicked button, get player’s name and then If player Is in group (ID) then
Enabled GUI

Can anyone help me about this?

You don’t need to get who clicked the button, it should already provide you the player like

button.Clicked:Connect(function(player)
      print(player)
end)

or if it’s a local script just do

local player = game.Players.LocalPlayer

If player is in a group: Player:IsInGroup

if player:IsInGroup(groupId) then
   print("blah")
end

Enabled Gui:

if player:IsInGroup(groupID) then
   gui.Enabled = true
end

if it’s a server script then you would need to make a remote event to fire to the client who clicked the button, and enable the gui from a local script when the event is fired.

1 Like