Server.lua can't find stuff in the config.lua

I’m having this error like
[ script:vivo_queue] Error loading script server/sv_vivo.lua in resource vivo_queue: @vivo_queue/server/sv_vivo.lua:230: attempt to index a nil value (global ‘Config’)
[ script:vivo_queue] stack traceback:
[ script:vivo_queue] @vivo_queue/server/sv_vivo.lua:230: in main chunk
[ c-scripting-core] Failed to load script server/sv_vivo.lua.

everything works in the code that take stuff from the config.lua
but on this on line it can’t get the stuff from config.lua

but this works

If you’re going to use the config file for serverside, you need to add the config.lua to the server files in the fxmanifest.lua, not just in the client files.

i did add config.lua in the fxmanifest

Screenshot of your fxmanifest?

image

Can we see the contents of your config file?

1 Like

Could you try to reverse the load order of the files in the fxmanifest.lua? I’m wondering if the server file is being parsed and not finding it before the config file even gets loaded.

well there no more error now so i think you fixed it man thx

there a new error

[ script:vivo_queue] SCRIPT ERROR: @vivo_queue/main.lua:239: attempt to index a nil value (field ‘body’)
[ script:vivo_queue] > GetMessage (@vivo_queue/main.lua:239)
[ script:vivo_queue] > userCallback (@vivo_queue/main.lua:96)
[ script:vivo_queue] SCRIPT ERROR: @vivo_queue/main.lua:127: attempt to compare number with nil
[ script:vivo_queue] > fn (@vivo_queue/main.lua:127)

You’re asking for help with code nobody can see. I’m sure you can understand how that will work out poorly for you.

well im tring to send the code but it wont work

that the code right there

Could you paste the code instead of images? Use preformatted text button above the text box here to format the code correctly.

local jsonCard = ‘{type = “AdaptiveCard”, minHeight = “100px”, ["$schema"] = “http://adaptivecards.io/schemas/adaptive-card.json”,version = “1.2”,body = { {type = “Image”,url = "’ … Config.design.bannerImage … ‘"},{type = “TextBlock”,text = “[1] Vivo (Vivo#0072), your current roles are:”,spacing = “Small”,horizontalAlignment = “Center”,weight = “Bolder”}, {type = “TextBlock”,text = “None - 0”,spacing = “Small”,horizontalAlignment = “Center”,weight = “Bolder”,color = “warning”}, {type = “TextBlock”,text = “Queue Length: 10 | Player Count: 0/64”,spacing = “Small”,horizontalAlignment = “Center”,weight = “Bolder”}, {type = “TextBlock”,text = “Consider visiting our store and donating for queue priority!”,horizontalAlignment = “Center”,weight = “Bolder”,size = “Small”,spacing = “Small”} },actions = { {type = “Action.OpenUrl”,title = “Discord”,iconUrl = “https://imgur.com/DKlC0na.png”,url = "’ … Config.design.discordLink … ‘"}, {type = “Action.OpenUrl”,title = “Store”,iconUrl = “https://imgur.com/S2Kj1H8.png”,url = "’ … Config.design.storeLink … ‘"} }}’

cardd.body[2].text = '[ ’ … tostring(#playersInfo) … ’ ] ‘… v.steamName … ’ (’ … v.discordName … '), your current roles are: ’

the code in ontop of this text

You haven’t provided the code where you are assigning “cardd” so we can’t check it to see why the body property is nil. Unless you provide more code, people can’t help you.
Also, when pasting code, as schwim mentioned use the preformatted text option. Here’s a tip… Use 3 backticks above and below it, and put the language after the first 3.

```lua
-- Code here
```

And it looks like this;

-- Code here

Sooooo much easier to read.