You are viewing an old version of this page. Return to the latest version.
Version of 17:11, 9 August 2016 by I need to Update My Profile
Difference between revisions of "LUA:AddCoin"
(Created page with "{{PageHeaderChild|LUA|AddCoin}} = LUA Functions: AddCoin() = Gives coins to the player ==== Syntax ==== AddCoin(param1, param2) ==== Parameters ==== ; Required - ''param1'' ...") |
m (Edited for simplicity (changed Spawn to Player) |
||
| (2 intermediate revisions by one other user not shown) | |||
| Line 1: | Line 1: | ||
| − | {{ | + | {{LUAFunction |
| − | + | |Name = AddCoin | |
| − | = | + | |Description = Add coins to the given spawn |
| − | + | |Param1 = Spawn | |
| − | + | |Param1Desc = is the player to add coins to | |
| − | + | |Param2 = int32 | |
| − | = | + | |Param2Desc = is the amount of coins to add |
| − | + | |Example = | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
<pre> | <pre> | ||
| − | function hailed(NPC, | + | function hailed(NPC, Player) |
| − | if IsPlayer( | + | if IsPlayer(Player) then |
| − | AddCoin( | + | AddCoin(Player, 10) |
Say(NPC, "Here have some copper") | Say(NPC, "Here have some copper") | ||
end | end | ||
end | end | ||
</pre> | </pre> | ||
| − | + | |ExampleDesc = When the NPC is hailed it will give the player 10 copper | |
| − | When the NPC is hailed it will give the player 10 copper | + | |Notes = Can only be use on a player. |
| − | + | }} | |
| − | |||
| − | Can only be use on a player. | ||
Latest revision as of 07:23, 7 February 2022
LUA:AllFunctions - AddCoin
Return to: LUA:AllFunctions | Tutorials | Portal | Forum | Project Manager | Bug Tracker
Add coins to the given spawn
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
Example
function hailed(NPC, Player)
if IsPlayer(Player) then
AddCoin(Player, 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.