i wanna do that will do it when clicket again it should go the visible false but it dint i put here the one wath i tried
local Plr = game.Players.LocalPlayer
Plr:GetMouse().KeyDown:Connect(function(M) if M == "m" then script.Parent.Visible = true if Plr:GetMouse().KeyDown:Connect(function(M) then script.Parent.Visible = false end) end end end)
I assume your script means that it toggles a part of the GUI when M is pressed:
local Plr = game.Players.LocalPlayer local Mouse = Plr:GetMouse() Mouse.KeyDown:Connect(function(Key) if Key == "m" then script.Parent.Visible = not script.Parent.Visible end end)
Make sure you also do this in a LocalScript or it won't work.