Advent
Custom RPG Maker
- Joined
- Oct 3, 2009
- Messages
- 306
- Reaction score
- 7
I used Alchemy script to create Mining system with skill but there is problem. When I use talkaction like this, nothing happens. Script supposed to show me my Mining level, procents and stuff.
--Edit--
After using castle mod, talkaction with !zamek didn't worked as well. Any resolve ?
- - - Updated - - -
Please help me. This script doesnt show any error in engine, every mod is loading but !mining is not working at all.
- - - Updated - - -<?xml version="1.0" encoding="UTF-8"?>
<mod name="Mining System" version="4.0" author="soul4soul" enabled="yes">
<config name="mininglib"><![CDATA[
function getCustomSkill(cid, storage)
return getPlayerStorageValue(cid, storage)
end
function addCustomSkill(cid, skillName, storage)
local skillStorage = math.max(10, getPlayerStorageValue(cid, storage))
local skillTries = math.max(0, getPlayerStorageValue(cid, storage+1))
doPlayerSetStorageValue(cid, storage, skillStorage+1)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You advanced in " .. skillName .. ".")
doPlayerSetStorageValue(cid, storage+1, 0)
end
function addCustomSkillTry(cid, skillName, storage)
local skillStorage = math.max(10, getPlayerStorageValue(cid, storage))
local skillTries = math.max(0, getPlayerStorageValue(cid, storage+1))
doPlayerSetStorageValue(cid, storage+1, skillTries + 1)
if skillTries > math.floor(20 * math.pow(1.1, (skillStorage-11)) / 10) then
addCustomSkill(cid, skillName, storage)
end
end
function getCustomSkillPercent(cid, storage)
local skillStorage = math.max(10, getPlayerStorageValue(cid, storage))
local skillTries = math.max(0, getPlayerStorageValue(cid, storage+1))
local triesNeeded = math.floor(20 * math.pow(1.1, (skillStorage-11)) / 10)
local percent = math.floor(100*(1-skillTries / triesNeeded))
if percent > 1 and percent <= 100 then
return percent
else
percent = 1
return percent
end
end
]]></config>
<talkaction words="!mining" event="buffer"><![CDATA[
domodlib('mininglib')
local skillIDs = {
{50500, "Mining"} -- The first ID is the skill value, the second ID is the name of the skill
}
local a = {}
skill = "Mining Level: " .. math.max(10, getCustomSkill(cid, skillIDs[1][1])) .. ". Percent to go: " .. getCustomSkillPercent(cid, skillIDs[1][1]) .. "%\n-------\n\n"
function onSay(cid, words, param, channel)
if(getPlayerAccess(pid) >= getPlayerAccess(cid)) then
doPlayerSendTextMessage(skill,cid, MESSAGE_STATUS_CONSOLE_BLUE)
return true
end
end
]]></talkaction>
</mod>
--Edit--
After using castle mod, talkaction with !zamek didn't worked as well. Any resolve ?
- - - Updated - - -
Please help me. This script doesnt show any error in engine, every mod is loading but !mining is not working at all.
Last edited: