-- setup local variables
local attendent = game.Workspace.AttendentBrick
-- when player clicks on attendent brick it will open gui if they are in group and certain rank
attendent.ClickDetector.onclicked:connect(function()
if (game.Players.LocalPlayer:IsInGroup(555451)) then
game.Lighting.FlightAttendentGui:Clone()
clo = game.Lighting.FlightAttendentGui:Clone()
clo.Parent = game.LocalPlayer.StarterGui
end
end)
The localscript is under the player. I want it to be when they click a brick, a gui will open up only if they are in a group. Sorry it must be bad since my main focus is building.

8 comments
'onclick' is not a valid event, consider changing to 'MouseClick'.
I'll try that
When I click it, I get the output "LocalPlayer is not a valid member of DataModel" now
Line 8 [game.LocalPlayer.StarterGui? Don't you mean game.Players.PlayerGui?].
Still nothing.
He meant "game.Players.LocalPlayer.PlayerGui."
All of you forgot the the Player is defined as a parameter within the connection.
If one of you would like to type that as an answer, I would be happy to like it and make it the solution