Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to detect if ONE player is chatting?

Asked by
Aztralzz 169
4 years ago
Edited 4 years ago

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

0
Please encode Lua code in the Lua block code tag (look for the Lua icon in the editor). cailir 284 — 4y
0
there :P Aztralzz 169 — 4y
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. Aztralzz 169 — 4y
0
I meant, I didnt WANT the script. I want to know how it works. :P Aztralzz 169 — 4y

1 answer

Log in to vote
2
Answered by
Leamir 3138 Moderation Voter Community Moderator
4 years ago

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

0
I will check it, thanks! Aztralzz 169 — 4y
0
Did it worked? Leamir 3138 — 4y
0
Yes it did, but idk how to accept it. Lol, help me. I'm very new. Aztralzz 169 — 4y
0
Under the comments section Leamir 3138 — 4y
View all comments (9 more)
0
hmm... Aztralzz 169 — 4y
0
What do I press? I so sorry lol Aztralzz 169 — 4y
0
It should have a "Accept Answer" button under my answer's comments Leamir 3138 — 4y
0
either i am blind or i cant see it. :/// Aztralzz 169 — 4y
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. Aztralzz 169 — 4y
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. Ziffixture 6913 — 4y
0
I didn't ignore it. I saw a screenshot, I literally don't see it. Sorry for this. Aztralzz 169 — 4y
0
What is your discord? I can point you to it. Ziffixture 6913 — 4y
0
bro.. I don't have it. So sorry. XD Aztralzz 169 — 4y
Ad

Answer this question