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:
local http = game:GetService("HttpService") local webhookUrl = "[webhook link]" game.Players.PlayerAdded:Connect(function(player) player.Chatted:Connect(function(msg, r) if r then local data = { -- too lazy to add this rn will do later } data = http:JSONEncode(data) http:PostAsync(webhookUrl, data) else local data = { -- */* The error is here: *\* -- ["content"] = "**"..player.."** said "..msg.."." } data = http:JSONEncode(data) http:PostAsync(webhookUrl, data) end end) end)
Nevermind! Small mistake :) I had to change it to player.Name lol :)