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

Some Things Request also some questions

Lbtg

Advanced OT User
Joined
Nov 22, 2008
Messages
2,398
Reaction score
165
Request. I want an item when i eat it i gain 50 soul . Max Soul 200 ofc.

Question:Posible to make that player see hes all mana ? cuz when player reach like 1000 lvl he see hes mana low but but the thing he has huge mana. same With hp , Posible to fix maxmana show /maxhp show ?
 
Question: No, it overlaps at 65k.

Soul script:

LUA:
function onUse(cid, item, frompos, item2, topos)
local maxsoul = 200
local soultoadd 50 -- add 50 soul

if getPlayerSoul(cid) <= maxsoul then
doPlayerAddSoul(cid, soultoadd)
doRemoveItem(cid, item.uid, 1)
end
return true
end

I hope you can script actions.xml
 
doesnt work , when i try eat nothing happends . no erros on console , Using 0.3.6 .

my actions "<action itemid="5958" value="soul.lua"/>"
 
your script can go over 200 if the player has like 180 Soul and he uses the item, he would then get 230 Soul

use this one:
Code:
local maxSoul = 200
local maxSoulAdded = 50


function onUse(cid, item, frompos, item2, topos)
	local playerSoul = getPlayerSoul(cid)
	local soultoadd = (((playerSoul + maxSoulAdded) < maxSoul and maxSoulAdded) or (maxSoul - playerSoul))
	
	if soultoadd > 0 then
		doPlayerAddSoul(cid, soultoadd)
		doRemoveItem(cid, item.uid, 1)
	end
	return true
end
Untested, but should work fine :)
 
0.3.6 , when i try eat item nothing , happends.

PHP:
<action itemid="5958" value="soul.lua"/>


PHP:
local maxSoul = 200
local maxSoulAdded = 50


function onUse(cid, item, frompos, item2, topos)
	local playerSoul = getPlayerSoul(cid)
	local soultoadd = (((playerSoul + maxSoulAdded) < maxSoul and maxSoulAdded) or (maxSoul - playerSoul))
	
	if soultoadd > 0 then
		doPlayerAddSoul(cid, soultoadd)
		doRemoveItem(cid, item.uid, 1)
	end
	return true
end
 
Try:

LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
		local Maxsoul, Addsoul = 200, 50
	
	if getPlayerSoul(cid) + Addsoul >= 200 then
	doPlayerSendTextMessage(cid,25,"You cannot use this item as you currently have to much soul points.")
	elseif getPlayerSoul(cid) + Addsoul <= 200 then
	doPlayerAddSoul(cid, Addsoul)
	doPlayerSendTextMessage(cid,25,"You have received " .. Addsoul .. " soul points. You now have " .. getPlayerSoul(cid) .." soul points.")
	end
	return true 
	end
 
Back
Top