So I got this button, its supposed to Open a menu when left clicked and close it when clicked again. But I get "Button1Down is not a valid member of TextButton". Heres the code:
local open = script.Parent local box = open.Frame local map = box.Map local pic = box.Mapic open.Button1Down:connect(function(mouse) open.Text = "Close" map, box, pic.Visible = true if open.Text == "Close" and open.Button1Down then open.Text = "Teleport Menu" map, box, pic.Visible = false end end)
Not sure why it's saying this or what I am supposed to do about it. It's in a local script that's inside the button btw. Help please? :)
Button1Down does not exist in Lua. You can use 'MouseButton1Down', 'MouseButton1Click', 'MouseButton1Up' (for the left click button) and 'MouseButton2Down', 'MouseButton2Click', or 'MouseButton2Up'. Try using this script instead:
local open = script.Parent local box = open.Frame local map = box.Map local pic = box.Mapic open.MouseButton1Down:connect(function(mouse) open.Text = "Close" map, box, pic.Visible = true if open.Text == "Close" and open.MouseButton1Down then open.Text = "Teleport Menu" map, box, pic.Visible = false end end)
If my answer helped, please give it a thumbs up and accept it. Thank you!
That's because Button1Down doesn't exist. However, try MouseButton1Down and it should work.