What it's supposed to do is pop up, when you say "MainMenu/On", for you though. Not everyone else. So what I'm saying is it will pop up for only 1 player, if they say it. Can someone do this? And make it so if you say "MainMenu/Off", it will go not visible again.
if message:lower() == "MainMenu/On" then gui.Visible = not gui.Visible -- Sets GUI visibility to the opposite of what it was (toggle) end
I just edited an AFK script that I made previously. What helped me was the "How do I ban people from my place?" wiki article.
local function onChatted(msg, recipient, speaker) local msg = msg:lower() if msg == "mainmenu/on" then if not speaker.PlayerGui["Name of the main menu"].Visible == true then speaker.PlayerGui["Name of the main menu"].Visible = true elseif msg == "mainmenu/off" then if not speaker.PlayerGui["Name of the main menu"].Visible == false then speaker.PlayerGui["Name of the main menu"].Visible = false end end end end function onPlayerEntered(newPlayer) newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end) end game.Players.PlayerAdded:connect(onPlayerEntered) --------------------------- --| SHAWNYG PRODUCTIONS |-- ---------------------------
Shouldn't it be this?
if message:lower() == "MainMenu/On" then gui.Visible = false -- Sets GUI visibility to the opposite of what it was (toggle) end
Also, I could help you more if you included the whole script, as this does not look like a completed script.