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

How do i make a text when i chat something?

So i know this uses an onchatted function basically when i type in /me (text) i want the thing they type to come up in a writing with there name beside it this is an example

http://prntscr.com/f726aa

So i type that into the chat and this is what happens

http://prntscr.com/f727iv

Im completely clueless on how do it i have tryed multiple times may somebody help me.

1 comment

0

post code

2 answers

✓ Accepted answer

Ok, so it seems like you want it to get what the player says after the /me.

To do this you can do something like:

game.Players.PlayerAdded:Connect(function(Player)
	Player.Chatted:Connect(function(ChatText)
			print(Player.Name, " has chatted")
		if  string.sub(ChatText,1,3):lower() == "/me" then     --Checking if the player says "/me", I am lowering it because they player might do the m uppercase or e uppercase
			local afterText = string.sub(ChatText,  4) --When using string.sub(), first argument is the string and the second is from where it shall begin, third (optional) is deciding if you want to check from 1 to 2
			print(afterText)
		end
	end)
end) 

game.Players.PlayerAdded:connect(function(player)
    player.Chatted:connect(function(msg)
       if msg == "/me" then
	-- need help here
end

1 comment

0

I have to break up the msg and get what they say after "/me" and make the text say that

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