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

[LUA] static loss reducement script going wrong

Swiff

Member
Joined
Apr 6, 2009
Messages
366
Reaction score
12
Location
Sweden
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 1)
	doPlayerSendTextMessage(cid,22,'Enlighted.')
	doRemoveItem(item.uid, 1)
	return true
end

So, the
LUA:
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 1)
is not working. lost 2% on death before using this item, and lost 2% on death after using this item. What could be wrong?

I'm just trying to start making my own scripts, so far I've managed a few.. Easier ones, but this one is above me;p

Thanks in advance for your help!
 
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 1)
	doPlayerSendTextMessage(cid,22,'Enlighted.')
	doRemoveItem(item.uid, 1)
	return true
end

So, the
LUA:
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 1)
is not working. lost 2% on death before using this item, and lost 2% on death after using this item. What could be wrong?

I'm just trying to start making my own scripts, so far I've managed a few.. Easier ones, but this one is above me;p

Thanks in advance for your help!

try this:
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	doPlayerSetLossPercent(cid, LOSS_EXPERIENCE, 1)
	doPlayerSendTextMessage(cid,22,'Enlighted.')
	doRemoveItem(item.uid, 1)
	return true
end
Hope it helps!
 
Back
Top