Frosbite
Active User
- Joined
- Dec 20, 2014
- Messages
- 99
- Reaction score
- 8
Witam serdecznie. Przedstawiam skrypt bardzo prosty w dzia?aniu i configu.
Dzia?anie skryptu polega na d?wigni kt?ra tworzy potwory co? jak na Wodbo Bianco je?eli kto? wie o co chodzi.
A wi?c :
Actions.xml
[XML]<action actionid="1000" script="skrypt.lua"/>[/XML]
Actions/scripts/skrypt.lua
[LUA]local config = {
exhaustDuration = 500, -- 1000 = 1 sec
leverId = 1945, -- switch ID you have put on map | id dzwigni ktora postawiono na mapie
leverIdOnUse = 1946, -- switch ID to switch to after using it | id na ktory dzwignia ma sie zmienic po uzyciu
showErrors = "No" -- show errors while creating monster | pokaz bledy podczas tworzenia potworka
}
config.greetMsg = getBooleanFromString(config.greetMsg)
config.showErrors = getBooleanFromString(config.showErrors)
-- make sure there is no comma on the line of last monster | upewnij sie ze przy ostatnim potworku nie ma przecinka
local monsters = {
{name = "Wolf"}, -- id = 1, uid = 1001
{name = "Wolf"}, -- id = 1, uid = 1002
{name = "Android"}, -- id = 1, uid = 1003
{name = ""} --
}
function onUse(cid, item, pos)
local monster_id = item.uid - 1000
if(item.itemid == config.leverId) then
doTransformItem(item.uid, config.leverIdOnUse)
addEvent(doTransformItem, config.exhaustDuration, item.uid, config.leverId)
monster = doCreateMonster(monsters[monster_id].name, getCreaturePosition(cid), config.showErrors)
return monster
else
doPlayerSendDefaultCancel(cid, RETURNVALUE_CANNOTUSETHISOBJECT)
return true
end
return true
end[/LUA]
Tyle, najlepiej nie usuwa? ostatniego "{name = ""}" bo nie b?dzie kto? mniej znany si? martwi? ?e jest "," w ostatnim.
Pozdrawiam
Dzia?anie skryptu polega na d?wigni kt?ra tworzy potwory co? jak na Wodbo Bianco je?eli kto? wie o co chodzi.
A wi?c :
Actions.xml
[XML]<action actionid="1000" script="skrypt.lua"/>[/XML]
Actions/scripts/skrypt.lua
[LUA]local config = {
exhaustDuration = 500, -- 1000 = 1 sec
leverId = 1945, -- switch ID you have put on map | id dzwigni ktora postawiono na mapie
leverIdOnUse = 1946, -- switch ID to switch to after using it | id na ktory dzwignia ma sie zmienic po uzyciu
showErrors = "No" -- show errors while creating monster | pokaz bledy podczas tworzenia potworka
}
config.greetMsg = getBooleanFromString(config.greetMsg)
config.showErrors = getBooleanFromString(config.showErrors)
-- make sure there is no comma on the line of last monster | upewnij sie ze przy ostatnim potworku nie ma przecinka
local monsters = {
{name = "Wolf"}, -- id = 1, uid = 1001
{name = "Wolf"}, -- id = 1, uid = 1002
{name = "Android"}, -- id = 1, uid = 1003
{name = ""} --
}
function onUse(cid, item, pos)
local monster_id = item.uid - 1000
if(item.itemid == config.leverId) then
doTransformItem(item.uid, config.leverIdOnUse)
addEvent(doTransformItem, config.exhaustDuration, item.uid, config.leverId)
monster = doCreateMonster(monsters[monster_id].name, getCreaturePosition(cid), config.showErrors)
return monster
else
doPlayerSendDefaultCancel(cid, RETURNVALUE_CANNOTUSETHISOBJECT)
return true
end
return true
end[/LUA]
Tyle, najlepiej nie usuwa? ostatniego "{name = ""}" bo nie b?dzie kto? mniej znany si? martwi? ?e jest "," w ostatnim.
Pozdrawiam