How do I add quiz question?

All questions can be found in wos/ufs/fb/questions/ When creating your own questions you can either create a new lua file for it or use the already existing one. Here is an example of a question.

wOS.UFS:RegisterQuestion({
    Question = "Is this the ? formation (True)", -- The Question
    Response = function(wanswers, formData)
        local q = "Is this the "..formData.Name.." formation"
        local results = {}
        local r = math.random(1, 2)
        results[r] = "True"
        if r == 1 then
            results[r] = "True"
            results[2] = "False"
        elseif r == 2 then
            results[1] = "False"
            results[r] = "True"
        end
        return "True", results, q
    end
})

The Question attribute is the name of the question but will also function as the displayed question if you don't provide another one. The Response attribute is where you generate the answers the player can choose from, you also need to provide the correct answer, this is also where you can change the question displayed to the character by providing another question. The return order for this function is the correct result then the answers, and finally the question OR and empty string ("") If you don't need to change the question.

  • 0 Utilisateurs l'ont trouvée utile
Cette réponse était-elle pertinente?

Articles connexes

What are the tablet controls?

Tablet controls are as follows:...

How do I craeate new preset formation?

All Preset formations can be found in wos/ufs/fb/formations/ When creating your own formation you...

How can I reward my players for staying in formation?

Rewarding players in formation. You can choose to reward players at set intervals for being in...