Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can i?

Asked by
Subbix -5
10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
01local player = game.Players.LocalPlayer
02local mouse = player:GetMouse()
03local Plyr = game:GetService("Players")
04 
05function onKey(key)
06    if key == "q" then
07        a=Game.Lighting:FindFirstChild("Shop")
08    end
09end
10mouse.KeyDown:connect(onKey)

How can i make the above everytime i click q it will appear it then dissapear it when i click q again?

1 answer

Log in to vote
0
Answered by
ZeroBits 142
10 years ago

add this after a is defined. oh, and

please make your question title relevant to your question content. it says it in plain text.

1b=player.PlayerGui:FindFirstChild("Shop")
2if b~=nil then
3b:Destroy()
4else
5a:Clone().Parent=player.PlayerGui
6end
Ad

Answer this question