• 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!

Working script, but need some help!

Crunch

Member
Joined
Jun 21, 2011
Messages
353
Reaction score
19
Location
England
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.

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
 
honestly, I prefer to do cooldowns myself rather then use the condition/default exhaust system

Code:
local outfit = 287
local time = 240 -- Minutes
local exhaustStorage = 24022
local exhaustTime = 240 --Minutes
 
 function onUse(cid, item, fromPosition, itemEx, toPosition)
        if getPlayerStorageValue(cid, exhaustStorage) < os.time() then
        doSetMonsterOutfit(cid, outfit, time * 60 * 1000)
        doCreatureSay(cid, 'Text', TALKTYPE_ORANGE_1)
        doSendMagicEffect(getPlayerPosition(cid), 38)
        setPlayerStorageValue(cid, exhaustStorage, os.time() + (exhaustTime * 60))
    else 
        doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
    end
    return true
end
(Made in reply)
this should work :)
 
Thanks :D the exhaust works perfectly! Any ideas on the outfit thing? I'm using an 8.6 rev so I don't think I can do cooldowns?

Is your avatar Khaleesi from Game of Thrones?
 
I used the same function its used on TFS for the /newtype command, so that should also work

yeah it is :)
Her name is Daenerys Targaryen btw :p
 

Similar threads

Back
Top