Hello, I've made a script, its where if you use vampire doll you will change into a vampire lord. It works fine, only thing I would like to add is that if someone changed outfit, goes invisible, or changes there appearance it will go away. At the moment only way to make it go in logging on/off or waiting for the time to run out.
I've also tried to add exhaust, but failed lol, some help on that would be appreciated too! I'll post my script before exhaust and after.
With my exhaust attempt
Thanks in advance
I've also tried to add exhaust, but failed lol, some help on that would be appreciated too! I'll post my script before exhaust and after.
Lua:
local config = {}
local outfit = { lookType = 287}
local time = 240 -- Minutes
function onUse(cid, item, fromPosition, itemEx, toPosition)
doSetCreatureOutfit(cid, outfit, time * 60 * 1000)
doCreatureSay(cid, 'Text', TALKTYPE_ORANGE_1)
doSendMagicEffect(getPlayerPosition(cid), 38)
return true
end
With my exhaust attempt
Lua:
local config = {}
local outfit = { lookType = 287}
local time = 240 -- Minutes
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (750))
function onUse(cid, item, fromPosition, itemEx, toPosition)
doSetCreatureOutfit(cid, outfit, time * 60 * 1000)
doCreatureSay(cid, 'Text', TALKTYPE_ORANGE_1)
doSendMagicEffect(getPlayerPosition(cid), 38)
return true
end
if(hasCondition(cid, CONDITION_EXHAUST)) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return true
end
Thanks in advance