Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Attempted to Concatenate Instance with String?

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)

2 comments

0

Slap me pls, because i don't answer XDD maybe tomorrow

0

Get /slap'd

1 answer

Nevermind! Small mistake :) I had to change it to player.Name lol :)

This discussion is preserved as it was. New answers, comments, and votes are closed.