No categories assigned

LUA:GetQuestCompleteCount

(Redirected from GetQuestCompleteCount)

LUA - GetQuestCompleteCount

Return to: LUA | Tutorials | Portal | Forum | Project Manager | Bug Tracker


GetQuestCompleteCount()

Gets the number of times the given quest has been completed by the given player


Syntax

var = GetQuestCompleteCount(param1, param2)

Parameters

Required - param1 (Spawn), param2 (int32)
param1 is a reference to a player.
param2 is the quest ID.

Returns

int16

Usage

function hailed(NPC, Spawn)
    local count = GetQuestCompleteCount(Spawn, Quest1)
    if count <= 4 then
        OfferQuest(Spawn, Quest1)
    else
        OfferQuest(Spawn, Quest2)
    end
end

This will offer the player a different quest if they completed Quest1 4 times