I am trying to make SurfaceGUI script that shows a GUI to someone who clicked it. I am trying to stock who clicked it with playerWhoClicked. Here's the script
Please ignore the massive amount's of Parent's.
script.Parent.MouseButton1Down:connect(function(playerWhoClicked)
groupid = game.Workspace.GroupID.Value
player = game.Player:getPlayerFromCharacter(playerWhoClicked)
if player then
gui = player.PlayerGui["EditBoard " ..script.Parent.Parent.Parent.Parent.Parent.Parent.Room.Value]
if player:IsInGroup(groupid) and player:RoleInGroup(groupid) >=3 then
if gui.Background.Visible == false then
gui.Background.Visible = true
else
gui.Background.Visible = false
end
end
end
end)
script.Parent.MouseButton1Down:connect()
ERROR:
Line 3
Player is not a valid member of DataModel
Can anyone give me a new way to receive who clicked it?

2 comments
What line is the error on?
Line 3, Forgot that part.