My addon is not working but whith no lua error

The goal of my addon is to have a driving license editable by multiple instructors that are named by admins, but I havce a problem with the instructor menu which is is not refreshing the data i don’t know why

Serverside code : https://pastebin.com/SPBMLYyv
Clientside code : https://pastebin.com/vGVgMaku

It would be really great if you could help me ^^

No one knows ? D:

net.ReadInt
net.ReadInt( number bitCount )

You forgot to add the bitCount…



            while(true) do
                key = net.ReadString()
                if(key == "fin") then
                    break;
                elseif(key == "car") then
                    carl = net.ReadInt()
                    choice.carLicense = net.ReadInt()
                    choice.carLicensePoints = net.ReadInt()
                elseif(key == "bus") then
                    choice.busLicense = net.ReadInt()
                    choice.busLicensePoints = net.ReadInt()
                elseif(key == "truck") then
                    choice.truckLicense = net.ReadInt()
                    choice.truckLicensePoints = net.ReadInt()
                elseif(key == "instructors") then
                    choice.carInstructor = net.ReadInt()
                    choice.busInstructor = net.ReadInt()
                    choice.truckInstructor = net.ReadInt()
                end
          end


By the way this would produce a Lua error

There was no error :confused: Thanks I will test this ^^

This just shows where problem is.
I didn’t fixed it for him.

I was pointing out that OP said there was no error, but the code would clearly produce one if it were to run

After looking at the code - why do you have while true do? There’s practically never a reason to use that
It’s probably also why you didn’t receive an error - key was always “fin” (Use UInts btw, they’re a lot cheaper)

Nope no lua error but the data stills don’t refreshing

[editline]23rd July 2017[/editline]

new serverside https://pastebin.com/fp2eUGJW
new clientside https://pastebin.com/ktDM37fS

Thanks Jason I will also check that

[editline]23rd July 2017[/editline]

Jason why would the key always be “fin” ?
fin is send at the end of the write string
And the plugin had that issue before i added the loop

Wouldn’t


while true do

crash your game?
Create a Think hook instead if you want to run something forever.

Unless there’s a break, but he only has it down one branch so I wouldn’t rely on it.