• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

How to add exhaustion

killing

Member
Joined
Feb 23, 2012
Messages
815
Reaction score
11
Location
BIH
How to add exhaustion = 15000

LUA:
local storage = 11989
local protectiontime = 15
 
local function endProtection(cid)
	doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_RED)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Protection ended.")
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
 
	if getPlayerStorageValue(cid, storage) >= os.time() then
		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) 
		doPlayerSendCancel(cid, "You are still protected by this doll.")
		return true
	end
	setPlayerStorageValue(cid, storage, os.time()+protectiontime)
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You are now protected by this doll for 15 seconds.')
	doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_GREEN)
	addEvent(endProtection, 15000, cid)
	return true
end
 
Like this

LUA:
local storage = 11989
local protectiontime = 15
 
local function endProtection(cid)
	doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_RED)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Protection ended.")
end
if (exhaustion.get (cid, 11989)) then
doPlayerSendCancel (cid, "You can use it one time per 15 secs.")
return TRUE
else
exhaustion.set(cid, 11989, 15)
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
 
	if getPlayerStorageValue(cid, storage) >= os.time() then
		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) 
		doPlayerSendCancel(cid, "You are still protected by this doll.")
		return true
	end
	setPlayerStorageValue(cid, storage, os.time()+protectiontime)
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You are now protected by this doll for 15 seconds.')
	doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_GREEN)
	addEvent(endProtection, 15000, cid)
	return true
end

- - - Updated - - -

This Dont work

- - - Updated - - -

Limos can help xD

- - - Updated - - -

This is Not working!!
When player use doll i want to player then loss doll!!
How to make that possible??Repp
 
ye ye ye...
I know aand i try and When i add

LUA:
if (exhaustion.get (cid, 11989)) then
doPlayerSendCancel (cid, "You can use it one time per 15 secs.")
return TRUE
else
exhaustion.set(cid, 11989, 15)
end

I cant use Doll lol
How i can make when player use doll to doll disappears?
 
Can you explain me how it should work?


Player use the "Doll"
If Player have idk 2 Protection dolls
and if player use then player well have only one left...

How Do not you understand!!
When player use the Doll I want to it Delete!


LUA:
local storage = 11989
local protectiontime = 15
 
local function endProtection(cid)
	doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_RED)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Protection ended.")
end
if (exhaustion.get (cid, 11989)) then
doPlayerSendCancel (cid, "You can use it one time per 15 secs.")
return TRUE
else
exhaustion.set(cid, 11989, 15)
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
 
	if getPlayerStorageValue(cid, storage) >= os.time() then
		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) 
		doPlayerSendCancel(cid, "You are still protected by this doll.")
		return true
	end
	setPlayerStorageValue(cid, storage, os.time()+protectiontime)
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You are now protected by this doll for 15 seconds.')
	doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_GREEN)
	addEvent(endProtection, 15000, cid)
	return true
end
 
Back
Top