Help with minor bug or smth

Hello!
I encountered some kinda of bug in my script that I can’t seem to figure out what is wrong.
Context:
I made myself a small command that skips a loading screen in a localscript
Before you guys go commands should be serversided to prevent exploiters, etc., this command isn’t really game-breaking its just for me so when I playtest my game I can just type the command to skip the loading screen whenever, etc.
The Code that does this:

game.Players.LocalPlayer.Chatted:Connect(function(msg)

	if tostring(game.Players.LocalPlayer.Name) == "awesome12734568" then
		if string.lower(tostring(msg)) == "!system deploy" then
			deployed()
		end
	end
end)

Notes:

  • The function itself works perfectly fine. The main issue is that whenever I chat the command the “chatted” event itself doesn’t fire (I tested it with some debugging). Now this piece of code used to work like a month ago and now when I came back to work on stuff it just stopped working which is annoying during playtests.
  • Any insight is appreciated, thank you for your time!
2 Likes

I dont think chatted works anymore
Considering they forced everyone to migrate, im not sure why .Chatted isn’t deprecated

edit: or not?

from what I can tell on the linked thread, it is broken with the new command objects, but I assume you’re not using them?

(From what I can tell though, .Chatted will eventually be deprecated anyways, so its probably best to migrate)

2 Likes

whats the other version of chatted?

they cover it in the first post I linked
TextChatService.SendingMessage, but theres some differences so its better that you read that post

Thank you for informing me I will try this soon and post this as a solution if it does work. I did not know that they are migrating to TextChatService.
Minor question is this an issue/migration for LocalScripts, because the server is detecting the chatted command but not the client when I tested it further.

I’m not really sure, since the last time I worked on this was back when the forced migration was first happening, which was a while ago.
Its possible thats the problem, since I do remember thinking that the new system was more centralized on the server. (Although either way its better to switch)

1 Like

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