Difference between revisions of "LUA:SetSkillValue"
(Created page with "= LUA Functions: GetSkillValue() = Gets the current value of the given skill ==== Syntax ==== GetSkillValue(param1) ==== Parameters ==== ; Required - ''param1'' (Skill) : ''pa...") |
|||
| Line 1: | Line 1: | ||
| − | = LUA Functions: | + | = LUA Functions: SetSkillValue() = |
| − | + | Sets the current value of the given skill | |
==== Syntax ==== | ==== Syntax ==== | ||
| − | + | SetSkillValue(param1, param2) | |
==== Parameters ==== | ==== Parameters ==== | ||
| − | ; Required - ''param1'' (Skill) | + | ; Required - ''param1'' (Skill), ''param2'' (int16) |
| − | : ''param1'' is the skill who's | + | : ''param1'' is the skill who's value we want to set |
| + | : ''param2'' is the value we want to set it to | ||
==== Usage ==== | ==== Usage ==== | ||
<pre> | <pre> | ||
| − | function | + | function respec(Player) |
| − | skill = GetSkill( | + | skill = GetSkill(Player, "Offence") |
if skill ~= nil then | if skill ~= nil then | ||
| − | + | SetSkillValue(skill, 35) | |
| − | |||
| − | |||
end | end | ||
end | end | ||
</pre> | </pre> | ||
| − | + | When this function is called the players offence skill value will be set to 35 | |
| + | |||
| + | == Note == | ||
| + | If the value exceeds the skill's max value it will be set to max value instead | ||
Latest revision as of 12:36, 22 November 2013
LUA Functions: SetSkillValue()
Sets the current value of the given skill
Syntax
SetSkillValue(param1, param2)
Parameters
- Required - param1 (Skill), param2 (int16)
- param1 is the skill who's value we want to set
- param2 is the value we want to set it to
Usage
function respec(Player)
skill = GetSkill(Player, "Offence")
if skill ~= nil then
SetSkillValue(skill, 35)
end
end
When this function is called the players offence skill value will be set to 35
Note
If the value exceeds the skill's max value it will be set to max value instead