Skip to content

GetQuestByKey

The id of the quest with a key.

A quest’s id lasts until the server restarts; its key is the mode’s own. A mode saves its players’ quests by key and finds each one again with this - or hands the key itself to any quest function, which takes either.

GetQuestByKey(key)
Parameter Type
key string the quest’s key, as given to CreateQuest (upper and lower case differ)

number - the quest’s id; nil when no quest has the key

local id = GetQuestByKey("abbots_errand")
if id then StartPlayerQuest(pid, id) end

CreateQuest · GetPlayerQuests · SetPlayerQuest · the Quests group of the index