I need help when Im trying to change gsp nothing happens
local MIN_HEALTH = 450
local MAX_HEALTH = 480
local MIN_MANA = 280
local MAX_MANA = 300
local EMPTY_POTION = 7635
local exhaust = createConditionObject(CONDITION_EXHAUSTED)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, getConfigInfo('timeBetweenExActions'))
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPlayer(itemEx.uid) == FALSE then
return FALSE
end
if hasCondition(cid, CONDITION_EXHAUSTED) == TRUE then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return TRUE
end
if not(isPaladin(itemEx.uid)) or getPlayerLevel(itemEx.uid) < 80 then
doCreatureSay(itemEx.uid, "Only paladins of level 80 or above may drink this fluid.", TALKTYPE_ORANGE_1)
return TRUE
end
if doCreatureAddHealth(itemEx.uid, math.random(MIN_HEALTH, MAX_HEALTH)) == LUA_ERROR or doPlayerAddMana(itemEx.uid, math.random(MIN_MANA, MAX_MANA)) == LUA_ERROR then
return FALSE
end
doAddCondition(cid, exhaust)
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
doTransformItem(item.uid, EMPTY_POTION)
return TRUE
end
using 8.31, anyone know why?
local MIN_HEALTH = 450
local MAX_HEALTH = 480
local MIN_MANA = 280
local MAX_MANA = 300
local EMPTY_POTION = 7635
local exhaust = createConditionObject(CONDITION_EXHAUSTED)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, getConfigInfo('timeBetweenExActions'))
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPlayer(itemEx.uid) == FALSE then
return FALSE
end
if hasCondition(cid, CONDITION_EXHAUSTED) == TRUE then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return TRUE
end
if not(isPaladin(itemEx.uid)) or getPlayerLevel(itemEx.uid) < 80 then
doCreatureSay(itemEx.uid, "Only paladins of level 80 or above may drink this fluid.", TALKTYPE_ORANGE_1)
return TRUE
end
if doCreatureAddHealth(itemEx.uid, math.random(MIN_HEALTH, MAX_HEALTH)) == LUA_ERROR or doPlayerAddMana(itemEx.uid, math.random(MIN_MANA, MAX_MANA)) == LUA_ERROR then
return FALSE
end
doAddCondition(cid, exhaust)
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
doTransformItem(item.uid, EMPTY_POTION)
return TRUE
end
using 8.31, anyone know why?