i have tried several times to get the buttondown1 function to work. Im using this function for a text button, for a menu that after pressing 'play' it teleports the player to the selected location.
Put this script inside of your button, and change the print to do whatever you need.
local btn = script.Parent btn.MouseButton1Click:Connect(function() print('clicked') end)
Put this in a LocalScript, then parent the localscript to the button. Change "TPpart" to the name of the part you want the player to teleport to when they click the button. Make sure CanCollide is set to false else the player can get stuck.
script.Parent.MouseButton1Click:Connect(function() local player = game.Players.LocalPlayer player.Character.HumanoidRootPart.CFrame = game.Workspace.TPpart.CFrame -- Change "TPpart" to the name of the part. -- end)
Video demo of script in use: https://imgur.com/a/gLmIXxv