• 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!

OX like metin2

how hard can it be to generate talkaction via chat gpt that will query list of items for their attack and what not and create random questions? very easy.

warning this is sample code generated from 1 prompt it will not work but should give you idea or steps:
its probably missing some registers and what not im just showing you do not need much knowledge to write scripts as such.

Lua:
function onOXEvent(player, command, parameters)
    if command == "start" and isPlayerGM(player) then
        -- Select a random item from the list
        local items = {"rapier", "longsword", "mace", "plate armor", "chain armor"}
        local selectedItem = items[math.random(1, #items)]
        
        -- Determine the question type (item name or attribute)
        local questionType = math.random(1, 2) -- 1 for item name, 2 for attribute
        local question, correctAnswer
        
        if questionType == 1 then
            -- Question about item name
            question = "What is the attack or defense value of " .. selectedItem .. "?"
            correctAnswer = getItemAttribute(selectedItem, "attack") or getItemAttribute(selectedItem, "defense")
        else
            -- Question about item attribute
            local attribute = math.random(1, 2) -- 1 for attack, 2 for defense
            if attribute == 1 then
                question = "What is the attack value of " .. selectedItem .. "?"
                correctAnswer = getItemAttribute(selectedItem, "attack")
            else
                question = "What is the defense value of " .. selectedItem .. "?"
                correctAnswer = getItemAttribute(selectedItem, "defense")
            end
        end
        
        -- Send the question to all players
        broadcastMessage(question)
        
        -- Record the correct answer and reward
        registerOXQuestion(selectedItem, correctAnswer)
    end
end

function onOXAnswer(player, answer)
    local correct, reward = checkAnswer(player, answer)
    if correct then
        giveReward(player, reward)
    end
end

-- Helper functions to be implemented
function isPlayerGM(player) end
function getItemAttribute(item, attribute) end
function registerOXQuestion(item, correctAnswer) end
function checkAnswer(player, answer) end
function giveReward(player, reward) end

registerTalkAction("ox", "onOXEvent")
registerEvent("onOXAnswer")
 
Back
Top