"Attempt to compare number with nil"错误



当我触摸winpad(将触发上述代码的部分)时,它会一直显示错误

ServerScriptService。Pads:342:尝试比较数字

第342行

if Times < minTime and Timem < 1 and kicks == true and #Boosts == 0 then

下面是342行

周围的一些上下文
local BadgeIDValue = Winpad.KitFolder.Value:FindFirstChild("BadgeID")
local BadgeID = 0
if BadgeIDValue then BadgeID = BadgeIDValue.Value end
local TowerNameValue = Winpad.KitFolder.Value:FindFirstChild("ProperName")
local TowerName = "Unknown"
if TowerNameValue then TowerName = TowerNameValue.Value end
local difficulty = Winpad:GetAttribute("Difficulty")
local diffcolor = DifficultyDictionaryColors[difficulty]
local nicelevel = Winpad:GetAttribute("NiceLevel")
local isSC = Winpad:GetAttribute("isSC")
local winroom = Winpad:GetAttribute("Winroom")
local minTime = Winpad:GetAttribute("MinimalTime")
local CPsReq = Winpad:GetAttribute("CPsRequired")
local Time:string,Boosts:table<string>? = GetTimerRemote:InvokeClient(Player)
local checks = ServerStorage:FindFirstChild(Player.Name)
local towerac = v.Name
local Times = tonumber(string.sub(Time, 4, 5))
local Timem = tonumber(string.sub(Time, 1, 2))
local kicks = script.Switches.KicksEnabled.Value
if Times < minTime and Timem < 1 and kicks == true and #Boosts == 0 then
Kick(Player, Time, TowerName, difficulty, Boosts, script.KickReasons.TooEarly.Value) return
end
if checks and CPsFound and kicks == true and #Boosts == 0 then
for i, v in pairs(checks:GetChildren()) do
if checks:FindFirstChild(towerac.."_"..i) then
CPCount = CPCount + 1
end
end
end

minTime属性可能不存在再次检查Winpad属性

最新更新