Hi,
summon.lua
actions.xml
Note: exhausttime = 2 (2 second)
Can you change with red colour words.
Thanks~
summon.lua
Code:
function exhaust(cid, storevalue, exhausttime)
newExhaust = os.time()
oldExhaust = getPlayerStorageValue(cid, storevalue)
if (oldExhaust == nil or oldExhaust < 0) then
oldExhaust = 0
end
if (exhausttime == nil or exhausttime < 0) then
exhausttime = 1
end
diffTime = os.difftime(newExhaust, oldExhaust)
if (diffTime >= exhausttime or diffTime < 0) then
setPlayerStorageValue(cid, storevalue, newExhaust)
return 1
else
return 0
end
end
function onUse(cid, item, frompos, item2, topos)
local config = {
storevalue = 1000,
exhausttime = [COLOR="Red"]2[/COLOR],
newnPosition = {[COLOR="Red"]x=5475, y=5397, z=9[/COLOR]},
}
local monster = {
["[COLOR="Red"]Hero[/COLOR]"] = {[COLOR="Red"]x=5479, y=5395, z=9[/COLOR]}
}
for name, pos in pairs(monster) do
if (exhaust(cid, config.storevalue, config.exhausttime) == TRUE) then
if item.itemid == 1945 then
doSummonCreature(name, pos)
doTransformItem(item.uid,item.itemid+1)
break
elseif item.itemid == 1946 then
doSummonCreature(name, pos)
doTransformItem(item.uid,item.itemid-1)
break
else
doPlayerSendCancel(cid,"Sorry,not possible.")
end
break
else
doPlayerSendCancel(cid,"[COLOR="Red"]You Need Wait 2 Second.[/COLOR]")
doSendMagicEffect(getCreaturePosition(cid),CONST_ME_POFF)
end
end
return TRUE
end
actions.xml
Code:
<action uniqueid="[COLOR="Red"]6500[/COLOR]" script="[COLOR="Red"]summon[/COLOR].lua" />
Note: exhausttime = 2 (2 second)
Can you change with red colour words.
Thanks~