This is a regular script, inside a TextButton, inside a frame, inside another frame, inside a SurfaceGui.
bin.MouseButton1Click:connect(function(player)
if player.Name == bin.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Owner.Value then
bin.Parent.Parent.Parent.Click:Play()
if toggle == true then
toggle = false
bin.Style = Enum.ButtonStyle.RobloxRoundButton
bin.TextColor3 = Color3.new(0/255, 0/255, 0/255)
bin.Text = "Allow Visitors: Off"
else
toggle = true
bin.Style = Enum.ButtonStyle.RobloxRoundDefaultButton
bin.TextColor3 = Color3.new(255/255, 255/255, 255/255)
bin.Text = "Allow Visitors: On"
end
end
end)
The output says: Workspace.Kiosk.Screen.Screen.Screen.Frame.Frame.Button.Scr:5: attempt to index local 'player' (a nil value)
Not sure why it says player is a nil value with the player parameter. Any help?

2 comments
Thank you! I've never made an adorned object so it was a bit new to me. Thanks!
You're welcome!