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

Need help in some scripts!!!! PLX HELP!

Luciano

Member
Joined
Feb 18, 2010
Messages
998
Reaction score
24
Mana Ring i have add 25% more mana)
but health ring dont work ;/ why?
i put on equip and deequip, look items.xml
[.lua][./lua]<item id="2123" article="a" name="Health Ring">
<attribute key="weight" value="40"/>
<attribute key="description" value="This ring add you 25% more life!!"/>
<attribute key="maxHealthPointsPercent" value="125"/>
<attribute key="slotType" value="ring"/>
[./lua]

------
I need some other scripts too ;)

i have mana boster (add 150k mana only 1 time use and need 30k lv)
dont work... dont ADD the mana... (like ... player lv 30k, have x mana, after use he should have x+ 150k mana but he dont get the 150k mana lol)

function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerLevel(cid) < 30000 then
doCreatureSay(cid, "Only players with level 30k can use it.", TALKTYPE_ORANGE_1)
return true
end
if getPlayerStorageValue(cid,99112) == 2 then
doPlayerSendCancel(cid, "You can use this item once.")
return true
end
setCreatureMaxMana(cid,(getCreatureMaxMana(cid))+150000)
setPlayerStorageValue(cid,99112,2)

doCreatureSay(cid, "You have gained 150k mana!!", TALKTYPE_ORANGE_1)
return true
end

<action itemid="7440" event="script" value="manabooster.lua"/>

and health...
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerLevel(cid) < 30000 then
doCreatureSay(cid, "Only players with level 30k can use it.", TALKTYPE_ORANGE_1)
return true
end
if getPlayerStorageValue(cid,99114) == 2 then
doPlayerSendCancel(cid, "You can use this item once.")
return true
end
setCreatureMaxHealth(cid,(getCreatureMaxHealth(cid))+150000)
setPlayerStorageValue(cid,99114,2)

doCreatureSay(cid, "You have gained 150k health!!", TALKTYPE_ORANGE_1)
return true
end


----------------------
ok,
now the requests:

a broadcast thing.

Exemple:
Some scroll, the player use he get 8 broadcasts.
What?
He say !broadcast Text here.
He can only !broadcast if he have "charges" of broadcast.
If no have any, then just dont do !broadcast (lol?)
Btw: When use !broadcast, say whow many broadcasts left, example
the player got 8 bc now.
he use !broadcast Hi im a player \o/
Now you have 7 broadcasts lefts.

------
item "transform"
use on X item transform to Y
(like rich armor to upgraded rich armor (diferent ID's)

------

forever aol > what is it > id 2196 > works like a normal aol, infinite.... but IF THE PLAYER HAVE RED SKULL AND DIE, he dont lost anything.... also dont lost the aol too :P - aol its infinite now, but rs still lose itens ;/

------
exp potion > increase the exp rate by 2x of player - one time per day and it have duration = 1 hour

Lotery Bird > golden falcon. 9003 > Its like a lotery, when u use it u can win ONE item.
example (noob items)
using u can win:
k armor
g armor
mpa
k legs
g legs
... but like : u have 50 chance drop k armor, 40 g armor, 10 mpa....

I think its all for now :P


Thanks, and yeah,
im kind noob, im entering world of script, but it is fuc**** hard lol
 
Last edited:
I found the bug ^^
local storage, level, mana = 30000, 13477, 150000
should be
local storage, level, mana = 13477, 30000, 150000
 
^^ thanks man !! works fine now :)
What should i remove, if i want to make like... i can use it a loot...
and whow to make after use it remove?
 
Add Mana
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local level, storage, mana = 30000, 13377, 150000
	if(getPlayerLevel(cid) < level) then
		doPlayerSendCancel(cid, "You must be atleast level " .. level .. " to use this.")
	elseif(getPlayerStorageValue(cid, storage) == 1) then
		doPlayerSendCancel(cid, "You have already used this before.")
	else
		setCreatureMaxMana(cid, getCreatureMaxMana(cid) + mana)
		setPlayerStorageValue(cid, storage, 1)
		doCreatureSay(cid, "You have received " .. mana .. " extra mana points.", TALKTYPE_ORANGE_1)
                doRemoveItem(item.uid, 1)
	end
	return true
end

Add Health
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local level, storage, health = 30000, 13378, 150000
	if(getPlayerLevel(cid) < level) then
		doPlayerSendCancel(cid, "You must be atleast level " .. level .. " to use this.")
	elseif(getPlayerStorageValue(cid, storage) == 1) then
		doPlayerSendCancel(cid, "You have already used this before.")
	else
		setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + health)
		setPlayerStorageValue(cid, storage, 1)
		doCreatureSay(cid, "You have received " .. health .. " extra health points.", TALKTYPE_ORANGE_1)
                doRemoveItem(item.uid, 1)
	end
	return true
end

HEALTH RING

data/movements/movements.xml
PHP:
<movevent type="DeEquip" itemid="2123" slot="ring" event="script" value="hpring.lua"/>
<movevent type="Equip" itemid="2123" slot="ring" event="script" value="hpring.lua"/>
 
Last edited:
I added the mana ring also above. Enjoy :thumbup:

Edit:
I will change the "mana ring" to a "health ring" for ya.
 
Did you change the ring back to regular in items.xml?
Also edited the post, copy again... :huh:
 
This is what I tested and it worked perfectly.

Code:
local condition1 = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition1, CONDITION_PARAM_TICKS, -1)
setConditionParam(condition1, CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT, 125)

local ring_id = 2123
function onEquip(cid, item, slot)
	if(getPlayerSlotItem(cid, CONST_SLOT_RING).itemid == ring_id) then
		doAddCondition(cid, condition1)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Higher Hitpoints")
	end
	return true
end

function onDeEquip(cid, item, slot)
	doRemoveCondition(cid, condition1)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Removed Hitpoints")
	doPlayerSave(cid, true)
	return true
end
 
JDB, i got mana ring, i didnt make any script, just put ONEQUI and DEEQUIP.
and in items.xml add: maxmanapointspercent:
It works, but the life dont..
 
Last edited:
Back
Top