Ulysses
Ulysses Stuff => General Chat & Help and Support => Topic started by: Sir Klutch on April 05, 2017, 07:18:52 PM
-
Hello, I am receiving this error from a custom ulx motd menu everytime you join the server.
[ERROR] addons/ulx/lua/ulx/modules/cl/motdmenu.lua:78: attempt to call method 'find' (a nil value)
1. fn - addons/ulx/lua/ulx/modules/cl/motdmenu.lua:78
2. func - addons/ulib/lua/ulib/client/cl_util.lua:22
3. unknown - lua/includes/extensions/net.lua:32
The user who wrote this code is MrPresident. The code can be found here;
https://forums.ulyssesmod.net/index.php/topic,6113.msg29952.html#msg29952
The error is within
function ulx.rcvMotd( isUrl_, text )
isUrl = isUrl_
if not isUrl then
ULib.fileWrite( "data/ulx_motd.txt", text )
else
if text:find( "://", 1, true ) then
url = text
else
url = "http://" .. text
end
end
end
Help would be greatly appreciated!
-
This code is 4 years old. It's not surprising that it doesn't work.
What exactly are you trying to do?
-
Fix the error. Everything works as intended to.
-
You fixed it? What did you do to fix it?
-
Lol, sorry if you misunderstood. I did not fix the error, you asked 'What exactly are you trying to do?' and I said fix the error. I could probably gut it and everything would be fine. Also, I could perhaps add a conditional to make sure text exists, is a string, and has a .find method
if not ( ( text ) and ( type( text ) == "string" ) and ( text.find) ) then return end
Would most likely fix the error, yes. Although I cannot find where the function is being called.
-
I went ahead and gutted it.