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

Problem with water-pipe sctipt (Drunk)

Tony32

Veteran OT User
Joined
Jun 6, 2008
Messages
1,268
Reaction score
353
Hello guys!
I'm trying to make a functional water-pipe, but the drunkness doesnt really work.

This is the current code:
Code:
local drunk = createConditionObject(CONDITION_DRUNK)

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(fromPosition.x ~= CONTAINER_POSITION) then
          doAddCondition(cid, drunk)
          doSendMagicEffect(fromPosition,2)
          doCreatureSay(cid, "Aaaaaaaahhhh", TALKTYPE_ORANGE_1)
	else
		doSendMagicEffect(fromPosition, CONST_ME_HITBYFIRE)
		doCreatureSay(cid, "Ouch! Rather place it on the ground next time.", TALKTYPE_ORANGE_1)
		doCreatureAddHealth(cid, -10)
	end

	return true
end

But when I use it, I get the drunk icon for like one second then it dissapears.. Anyone know how to make it stay? And maybe an exhaust so I cant use it again while drunk.
will rep++ for help!

Thanks!
 
Add:
Code:
setConditionParam(drunk, CONDITION_PARAM_TICKS, 5 * 60 * 1000)
(5 = 5 minutes, 5m * 60s * 1000ms)

Under local drunk~.
 

Similar threads

Back
Top