ScriptsAboutBlogToolsKnowledge BaseReviewsFAQBasketDocsSupport
Luacrash

attempt to concatenate a nil value

Also seen as: concatenate a nil value attempt to concatenate (local) nil concatenation Lua

What causes it

Your code tried to join (..) a nil value into a string. Common when building a message or query with a variable that doesn't exist yet.

How to fix it

Ensure the value being concatenated exists and is a string or number.

  1. Read what's nil in the parentheses.
  2. Confirm it's set before the concatenation line.
  3. Add a fallback: local name = playerName or 'unknown'.
  4. Watch for typos in the variable name.

Related errors

Related guides

Still stuck? We can help.

Optimized, dual-framework scripts for QBCore and ESX from Viper Development — escrow protected, delivered instantly to your Cfx portal.