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

How to detect if ONE player is chatting?

Ok, so, this is my first post so I'm sorry if this is bad, but here we go.

I'm trying to make a rap game, and I can't figure out how to make it to where when a certain player is chatting, it puts the chat onto a text label. Can anyone help me out here? I'm very new to coding, so I tried searching it up for a while, but I couldn't find anything except for if all players were chatting, and I need to narrow it down to one. Thanks! By the way, this is what i've come up with so far.. :/

if rapper1.Value == Currentrapper.Value then
game.Players.LocalPlayer.Chatted:Connect(function(msg)
end)
end end

rapper1 value is the player picked currentrapper is the player(rapper1) rapping -Aztralzz

4 comments

0

Please encode Lua code in the Lua block code tag (look for the Lua icon in the editor).

0

there :P

0

By the way guys, if you dont know what I'm going for, play Auto Rap Battles on roblox, and it is the blue rectangle at the bottom of the screen that displays the rappers chat. All I want is the script for that thingy.

0

I meant, I didnt WANT the script. I want to know how it works. :P

1 answer

✓ Accepted answer

Hello, Aztralzz!

If you use player.Chatted, the assigned function will run everytime the player chats, so you can combine this to a if to detect if it's the desired player that's chatting:


game.Players.LocalPlayer.Chatted:Connect(function(msg)
	if rapper1.Value == Currentrapper.Value then -- Here we check if the player that chatted is the one we want...
		print(msg) -- This prints the message	
	end
end)

To change a gui text value you can use .Text

NOTE: If you want to change a playerGui, you need to change under player.PlayerGui

If this answers your question, please accept it

13 comments

0

I will check it, thanks!

0

Did it worked?

0

Yes it did, but idk how to accept it. Lol, help me. I'm very new.

0

Under the comments section

0

hmm...

0

What do I press? I so sorry lol

0

It should have a "Accept Answer" button under my answer's comments

0

either i am blind or i cant see it. :///

0

I don't see the button, but, I do accept the answer. I am sorry I cannot actually accept it, I can't find the button.

0

I did it for you. It is right below the answer, and is quite difficult to miss—you will should be prompted—please don't ignore the button deliberately.

0

I didn't ignore it. I saw a screenshot, I literally don't see it. Sorry for this.

0

What is your discord? I can point you to it.

0

bro.. I don't have it. So sorry. XD

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