FiGo Posted November 29, 2020 Posted November 29, 2020 How could i fix bad argument [expected string at argument 1 got boolean]
Tekken Posted November 29, 2020 Posted November 29, 2020 The code? That told you you are trying to compare a string "THIS IS A STRING" to a boolean false true -- those are booleans Like this if "TEXT" == true then --do something end depending on your code the right approche may be if "text" == tostring(VARIABLE) then -- do something end As I said earlier we need the code to give an exact answer. Good luck.
FiGo Posted November 30, 2020 Author Posted November 30, 2020 setAccountData(account, "unreadNotifications", getaa + 1) else setAccountData(account, "unreadNotifications", 1)
FiGo Posted November 30, 2020 Author Posted November 30, 2020 (edited) function addNotification(accname, message) local accName = accname local account = getAccount(accname) local getaa = getAccountData(account, "unreadNotifications") if getaa then setAccountData(account, "unreadNotifications", getaa + 1) else setAccountData(account, "unreadNotifications", 1) end local date, time = getTimeDate() local final = "["..date.. " - "..time.."]" if (not fileExists("notifs/"..accName..".log")) then log[accname] = fileCreate("notifs/"..accName..".log") else log[accname] = fileOpen("notifs/"..accName..".log") end if (not log[accname]) then return end if (not fileExists("notifs/"..accName..".log")) then return end if (fileGetSize(log[accname]) == 0) then fileWrite(log[accname], final.." "..message) else fileSetPos(log[accname], 0) theLine = fileRead(log[accname], 9999999) fileWrite(log[accname], "\n"..final.." "..message) end fileClose(log[accname]) end Edited November 30, 2020 by FiGo
Erlkonig Posted November 30, 2020 Posted November 30, 2020 Please, use "Insert Code" next time. What's the line "bad argument"?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now