Why is this simple little script not working


i dont see anything wrong with it, no typos, no errors, and its on a local script, but its not doing anything when i chat

1 Like

Where is the LocalScript Located?

LocalScripts only work in specific Environments, make sure thats in the correct one.

tried startergui and starterplayerscripts

because print needs to be formatted “print()” and not “print”

Do you mind showing a Video?

I’m not sure but can you check what ChatVersion you are using, make sure its on TextChatService, and not LegacyChatService

Its located in TextChatService in the Explorer.

Both work, Nothing wrong with it.

both work also print() didnt do anything

ah, I didn’t know that, interesting

what exactly is your goal with this script?

isnt it supposed to be

TextChatService.OnIncomingMessage:Connect(function(variableForChatMessage)
print("ok")
end) 

hope this helps!

OnIncomingMessage isn’t a Event, its a callback

ah okay one second, just going to look at it in studio

i’m pretty sure you did the function wrong?

local TextChatService = ame:GetService('TextChatService')
TextChatService.OnIncomingMessage:Connect(function(message: TextChatMessage)
print("ok")
end

for some reason it wont send but heres what does happen:


image
the script runs and all, but doesnt work

ok so now i found out it works in new games, probably the new chat system is the requirement

Because you are using LegacyChatService, Switch it to TextChatService, and that should fix the Issue

3 Likes

that might work, better than my code suggestion

change this here:
image
to textchatservice like xGOA7x said.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.