function talk(plr)
if plr:GetRankInGroup(1056046) >= 7 then
local Msg = Instance.new("Hint", workspace)
Msg.Text = "One Krabby Patty, please."
Msg:remove()
end
end
script.Parent.MouseButton1Up:connect(talk)
The script is inside a surface gui on a brick... And the parent of the button is a frame, the final parent is a surface gui. So the scripts parent is the button.
Might of confused you there....
This is a regular script inside a Textbutton. Every time I click the GUI, it says:
attempt to index local 'plr' (a number value)
What's wrong with it?
Help me...

3 comments
Oops, sorry I didn't explain my question well enough. The script is inside a surface gui... It's not in the starter gui. Props for a AMAZING explanation though
Alright, I will also try to write another one.
Just edited my new answer.