While testing the server with C# code i ran in to this problem.
The code seem to look good, so i think it must be the set up or x64/x84 or .NET version problem.
Any info on what NET version system inviroment or pre setup settings we should use?
Console output.
“Error loading script server.lua in resource plugins: server.lua:1: attempt to call a nil value (global ‘server_script’)
stack traceback:
server.lua:1: in main chunk
Failed to load script server.lua.”
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CitizenFX.Core;
using CitizenFX.Core.Native;
using static CitizenFX.Core.Native.API;
namespace realisticGTA
{
public class RealisticProjectServer : BaseScript
{
public RealisticProjectServer()
{
Tick += OnTick;
}
Yea sorry about that, i am confusing my self allot, but it is confusing, everytings changing allot, and all the files look the same.
i need to do some more testing, it might be code also. i am not sure.
Looks like i was right… you have wrong documentation, it seems like they mixed up the lua script way with the .net way.
This is how you load the scripts.
__resource.lua
the brackets need to be removed. in my case it seems. i read it your comment but i was so tired and frustrated it did not register in my mind that you where talking about __resource
i mixed up a couple documentations it seems you guys were right.
"
To make everything work we simply need to add the __resource.lua. Instead of saying the script names, we want to include the assembly name + extension. In my case it looks something like this:
client_script {
“BasicResourceShared.net.dll”,
“BasicResourceClient.net.dll”
}
server_script {
“BasicResourceShared.net.dll”,
“BasicResourceServer.net.dll”
}
And adding the start command in the server.cfg:
start basic-resource
Note: Use the name of the folder, not the name of the libraries. "