• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

modalwindow error on console

wafuboe

Active Member
Joined
Dec 24, 2010
Messages
884
Solutions
2
Reaction score
26
Well i installed modal window and installed aswell this crafting systems

When i click on the details to craft nothing happens and this error appears in console
34909
Code:
function onModalWindow(player, modalWindowId, buttonId, choiceId)
    local modalWindow
    for _, window in ipairs(modalWindows.windows) do
        if window.id == modalWindowId then
            modalWindow = window
            break
        end
    end

    if not modalWindow then
        return true
    end

    local playerId = player:getId()
    if not modalWindow.players[playerId] then
        return true
    end
    modalWindow.players[playerId] = nil

    local choice = modalWindow.choices[choiceId]

    for _, button in ipairs(modalWindow.buttons) do
        if button.id == buttonId then
            local callback = button.callback or modalWindow.defaultCallback
            if callback then
                callback(button, choice)
                break
            end
        end
    end

    return true
end
any idea? thanks by the way
 
Post your solution so people with the same problem can find the fix

add this on global.lua
Code:
function capAll(str)
    local newStr = ""; wordSeparate = string.gmatch(str, "([^%s]+)")
    for v in wordSeparate do
        v = v:gsub("^%l", string.upper)
        if newStr ~= "" then
            newStr = newStr.." "..v
        else
            newStr = v
        end
    end
    return newStr
end
 
Back
Top