• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Important - MOD - request help

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.
<?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>
- - - Updated - - -

--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:
~refresh

I managed to write script by myself. One question : How I can do formule where I am getting attributes from tabel to storage value ? Lets give it
t = {100,200,300,400,500}
getPlayerStorageValue (cid,miningtries)

I tried using loop
for i = 1,5 do
if getPlayerStorageValue (cid,miningtries) == t then SendAdvancedMessage

but this code is kinda bad. Any ideas ?

~since I am not requesting anything, please close thread.
 
Last edited:
Back
Top