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

How to make a .Chatted function say your text into a full message?

Here's what I have??

function Message(msg)
	Player = script.Parent.Parent
	if Player.Name == "umeh" or Player.Name == "Player" then
	if msg == "Message"..Chat.. then
			Instance.new("Message", game.Workspace)
			game.Workspace.Message.Text = Chat	
		end	
	end  
end

Help not working!

3 comments

0

I want it to say Message and all the other messages you were saying :/

0

You need to explain what you want to do better.

0

Like kohls admin :m {Text}

1 answer

✓ Accepted answer
Admins = {"umeh", "Player"} -- Admins

Player = script.Parent.Parent

function checkAdmin(plr) -- Checks admin
	for _,plrs in pairs(Admins) do
		if plrs:lower() == plr.Name:lower() then -- Checking if names in Admins table are equal to "plr"
			return true
		end
	end
end

Player.Chatted:connect(function(msg) -- Checks if Player chatted
	if checkAdmin(Player) then -- Checks if Player is an admin
		if msg:lower():sub(1,3) == ":m " then -- checks if the first 3 chars of the msg is ":m "
			local m = Instance.new("Message", workspace)
		        m.Text = "["..Player.Name.."]: "..msg:sub(4) -- Should make the message say "[Player]: Text here"
			wait(2)
			m:Destroy() -- Removes message
		end
	end
end)

I edited it a little so that you can add player names easier to the script, look over the script and if you don't understand any of it please just ask.

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