Hello! I need help with something! I am creating something where you can say a prompt such as :prompt1! What it will do is make the player who said it say a certain line! Its for my cafe training center so the trainer can just use the commands to say what they need? I have some script but i dont know how to change the message?
game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(msg)
if msg == ":prompt1" then
end
end)
end)
Your code runs when a new player is added. Consider removing “game.players.playeradded:connect(function(player)” as it is unnecessary.
Second, you have no code to run when the player chats :prompt1, therefore, it does not do anything. Maybe you could do a print(“Prompt1 Chatted!”) to check if it is working.
Now, having this on a server script isn’t bad, but it’s way easier to do this on a local script. I would make a RemoteEvent and fire it when the message is sent. Check the example code to help you.
Ok so when they say the command it needs to change the text to like a different sentence! Its for a cafe training center. So when they say :prompt1 itll say something like Hi! Welcome to training!
I think it should work if you just fire a RemoteEvent, then receive it on a server script. Then, on the server script, you can then just paste the code in that post I linked earlier to run when the function is received. Of course, you can scout through the code and change what the message should say.