No categories assigned

LUA:AddCoin

Revision as of 17:11, 9 August 2016 by Jabantiz (talk | contribs) (Created page with "{{PageHeaderChild|LUA|AddCoin}} = LUA Functions: AddCoin() = Gives coins to the player ==== Syntax ==== AddCoin(param1, param2) ==== Parameters ==== ; Required - ''param1'' ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

LUA - AddCoin

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


LUA Functions: AddCoin()

Gives coins to the player


Syntax

AddCoin(param1, param2)


Parameters

Required - param1 (Spawn), param2 (int32)
param1 is the player to add coins to
param2 is the amount of coins to add


Usage

function hailed(NPC, Spawn)
    if IsPlayer(Spawn) then
        AddCoin(Spawn, 10)
        Say(NPC, "Here have some copper")
    end
end

When the NPC is hailed it will give the player 10 copper

Notes

Can only be use on a player.