Attempted to Concatenate Instance with String?
Asked by
4 years ago Edited 4 years ago
I'm making a chat logging script for my game. It just sends all the chat messages to a discord webhook. I know how to combine strings and instances, I use it a lot. But for some reason It's not working here.
Here's my script:
01 | local http = game:GetService( "HttpService" ) |
02 | local webhookUrl = "[webhook link]" |
05 | game.Players.PlayerAdded:Connect( function (player) |
06 | player.Chatted:Connect( function (msg, r) |
11 | data = http:JSONEncode(data) |
12 | http:PostAsync(webhookUrl, data) |
16 | [ "content" ] = "**" ..player.. "** said " ..msg.. "." |
18 | data = http:JSONEncode(data) |
19 | http:PostAsync(webhookUrl, data) |