Sorry im new to scripting and i just really need help
local Button = script.Parent Box = script.Parent.Parent.Box function onClick() if Box.Visible == false then Box.Visible = true Button.Text = "CLOSE" elseif Box.Visible == true then Box.Visible = false Button.Text = "SHOP" end end Button.MouseButton1Click:connect(onClick)
I didnt attempt to do it yet because i have no idea how, please help
Try using UIS
local UIS = game:GetService("UserInputService") local btn = script.Parent local box = script.Parent.Parent.Box UIS.InputBegan:Connect(function(input) if input.KeyCode = Enum.KeyCode.X then if box.Visible == false then box.Visible = true btn.Text = "Close" elseif box.Visible == true then box.Visible = false button.Text = "Shop" end end end
Then put the mousebutton1click code below. Hope this helped!