"Attempt to compare number with nil" 错误

当我触摸到 winpad(触发上面代码的部分)时,它会不停地出现错误

ServerScriptService.Pads:342: attempt to compare number < nil

第 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
点赞
用户16665626
用户16665626

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

2021-08-16 06:42:43