So this is the error I’m currently getting and have no clue how to fix it… any help is appreciated
Error parsing script cl_toolbox.lua in resource menu: cl_toolbox.lua:1447: 'end' expected (to close 'function' at line 29) near <eof>
Paste : https://pastebin.com/wD4MQVF0

This function has too many ends

RegisterNetEvent("Traffic")
AddEventHandler("Traffic", function()
	local ped = GetPlayerPed(-1)
	if DoesEntityExist(ped) and not IsEntityDead(ped) then
		TaskStartScenarioInPlace(ped, "", 0, true)
	end
end)

sorry that was an accident when I was pasting into bin, even with that gone the error is still there

1 Like

Why would it be saying there was an error at like 1447 if it was a past issue.

1 Like

I believe I’m missing an end but not sure

What I am saying is the error you sent is telling you to fix the code I sent and the code I sent has the error fixed.

I did that, but now its

lua5.3: source_file.lua:1443: 'end' expected (to close 'function' at line 294) near <eof>

So I believe I’m missing a closing somewhere but it seems like when I fix one another one breaks

Okay then well now the error has changed… I wouldn’t have know that without you telling me that.

Also that is in a completely different Lua file. source_file.lua. Line 1443… It isn’t in your cl_toolbox.lua anymore

It’s from the same lua I’m using an online lua compiler to run it and see if it compiles (that’s why the error may look different than the console), I also have a sv_toolbox with only like 70 lines

1 Like

Why aren’t you using FiveM’s client / server error logging… How are you running an online compiler when most of these functions don’t exist in the online compiler… It is going to throw errors for EVERYTHING that isn’t standard Lua and undefined.

Running it in game I got the same errors except now it’s
cl_toolbox.lua:314: attempt to index a nil value (global 'CivActionsMenu') stack traceback: cl_toolbox.lua:314 in main chunk
I’m not sure what I’m suppose to return from that function?

1 Like

Basically that error is telling you CivActionsMenu is nil. I don’t use NativeUI in Lua so I am not really sure how exactly that is supposed to be so you might wanna look into how you are creating the Menus maybe. No idea.

I got it fixed and running, thank you for your help!

I didnt really help you much but glad you got it working :smile:

how you fix it???