#global chat help

1 messages · Page 1 of 1 (latest)

supple hedge
#

in the following script that recives incoming messages:

game:GetService("MessagingService"):SubscribeAsync("Chat",function(mesage)
print(mesage.Data)
end)

is it possible to get the username of whoever sent it? and if you can, how

supple hedge
#

task.wait(1)
person = game.Players:FindFirstChildOfClass("Player")

game:GetService("MessagingService"):SubscribeAsync("Chat",function(mesage)
print("RECIVING: "..mesage.Data)
workspace.Part.SurfaceGui.TextLabel.Text = "Recived: "..mesage.Data
end)

person.Chatted:Connect(function(chat)
print("SENDING: "..game:GetService("TextService"):FilterStringAsync(chat,person.UserId):GetNonChatStringForBroadcastAsync())
game:GetService("MessagingService"):PublishAsync("Chat",game:GetService("TextService"):FilterStringAsync(chat,person.UserId):GetNonChatStringForBroadcastAsync())
end)

#

idk how to get WHO sent it though

frigid sparrow
#

send like lua code

supple hedge
frigid sparrow
#

what is "Chat" topic?

supple hedge
#

oh nvm

#

just realised

supple hedge
#

theres only gonna be one topic

frigid sparrow
supple hedge
#

what?

frigid sparrow
#

if u said its done maybe message.Data has info abt player

supple hedge
#

message.Data is just what the second to last line is sending

#

all the code is just to filter it through the roblox filter though

frigid sparrow
cloud hareBOT
#

studio** You are now Level 5! **studio

supple hedge
#

just tell me bropray4k

supple hedge
#

@frigid sparrow if theres a way tell me

frigid sparrow
#

i still dont understand what u need

supple hedge
#

ok so

frigid sparrow
supple hedge
#

in THIS function

frigid sparrow
supple hedge
supple hedge
#

i already have the regular global chat working fine though

frigid sparrow
#

is username

supple hedge
frigid sparrow
#

uh um

#

wait

#

u mean when plrs sent to dms?

#

uh i see what u mean

supple hedge
#

well its gonna be a global chat

#

everybody recives every message sent to it and anyone can send a message to it

frigid sparrow
#

is this what u need?

supple hedge
#

i already have chatted event in it i think

#

for the second function

frigid sparrow
#
game.Players.PlayerAdded:Connect(function(player:Player)
    player.Chatted:Connect(function(message:string)
        print(player.Name, message)
    end)
end)```
#

??

supple hedge
#

yea its a max 1 server size

frigid sparrow
supple hedge
#

i already tried this

#

its uhhh

frigid sparrow
#

i cant understand ur problem

supple hedge
#

i think theres a way i can do this but im not sure how

#

i need a variable that's the player username

#

the username of who sent it

frigid sparrow
#

well it doesnt have it

#

so use another methods

#

thats strange

supple hedge
#

what

twin cedar
supple hedge
#

ive read through the whole creator hub thing like three times for that

supple hedge
#

hang on

#

i think i just thought of something i can do

frigid sparrow
#

explain what u need

#

noone can help u if we dont understand what u want

supple hedge
#

i did

#

bro

#

i think im helping you at this point

frigid sparrow
#

maybe im stupid

supple hedge
#

sorry about wasting your timecrying