[英]Error code: attempt to call a nil value [LUA]
按下“button2”后正常工作但一段時間后lua關閉錯誤:[Lua]“LUA”中的錯誤:嘗試調用零值
local webHookURL = Menu.TextBox("Webhook", "Webhook URL", 148, "", "Enter your webhook URL")
local message = ("Hello!")
local function hook(msg)
Http.PostAsync(string.format("%s",webHookURL:GetString()),
string.format("content=%s",msg))
Cheat.AddNotify("neverlose.cc", "Shared! Well done!")
end
button2:RegisterCallback(function()
hook(message)
end)
錯誤消息未指示調用發生在哪一行? 一個簡單的解決方法是在之前對其進行測試:
if type(var_that_will_be_called) == "function" then
var_that_will_be_called ()
end
但這並不能真正解決問題,只是避免錯誤...
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.