why is my printing, chatlogs script not working as i intended?
01 | function onChatted(msg, recipient, speaker) |
02 | local source = string.lower(speaker.Name) |
03 | msg = string.lower(msg) |
05 | print (speaker.Name.. msg) |
09 | function onPlayerEntered(Player) |
11 | Player.Chatted:Connect( function (msg, recipient) |
12 | onChatted(msg, recipient, Player) |
The script will go like this: First, the Player will talk. Second, it should print the username and the message. Example: raid6n: Can you be my friend?
The script doesn't work with an output of: 18:07:59.288 - ServerScriptService.Script:11: attempt to index local 'Player' (a nil value)
I don't know why it doesnt work as I defined what "Player" is in line 9
I'm not good at this, so please send an answer if you can. This is a regular script.