I have some basic screen gui knowledge, but for a place i am working on, i need to make the shop open when a key is pressed, similar to murder mystery. I do not need the entire shop script, just some help for opening and closing with the same button.
For this you would use the KeyDown event.
01 | --LocalScript |
02 |
03 | local player = game.Players.LocalPlayer |
04 | local mouse = player:GetMouse() |
05 |
06 | local open = false |
07 |
08 | mouse.KeyDown:connect( function (key) |
09 | if key = = "b" then --replace this with the key you want |
10 | if open = = false then |
11 | open = true |
12 | --open the shop |
13 | elseif open = = true then |
14 | open = false |
15 | --close the shop |
16 | end |
17 | end |
18 | end |