Attempted to concatenate instance with string

I am trying to send a webhook message to my Discord server, but a certain line of code keeps giving me trouble.

webhookService:createEmbed(url, "Promotion log", playerInstance.Value .. "has just promoted" .. PlayerInstanceToRank.UserId)

I’ve changed the instance to the value of that instance, so these should not be considered strings, however I am still getting this error. Even after looking at mistakes in different threads on this error I can’t find what the problem is. Am I doing something silly?

The error is happening because an instance is being concatenated with a string (it’s the instance that’s the problem). Strings only concatenate with other strings, so the values you concatenate should be considered strings.

The problem was that I accidentally used .Value on an instance that didn’t have one. Since it only had a name it just returned the playerInstance itself I believe. I should have used .Name. Changing that fixed the code.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.