Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Can someone help me?

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

2 comments

0

First issue that comes to mind is that if you make the message lowercase, it won't match the message you've set (which has uppercase letters)

0

I noticed that as well. On my script, if you want it lowered, I did that for you. If not? Remove my Line 2 and in lines 3 and 6, edit what they say.'

2 answers

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.

1 comment

0

Actually, your script is right, but there is no specific player.

This discussion is preserved as it was. New answers, comments, and votes are closed.