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

Shield gives Hp

Pro Warbringer

Retired with developing
Joined
Sep 23, 2008
Messages
3,582
Reaction score
25
Location
Austria
hello!
i need script for shield (any)
shield must give +100 to max hp!:wub:

Code:
local ID = 1337 -- The ID of the item 
local PLevel = 50 -- The level to use the item 
local Health = 100 -- The amount of health to get when equiping the ID 

function onUse(cid, item, fromPosition, itemEx, toPosition) 
  if item.itemid == ID and if getPlayerLevel(cid) >= PLevel then 
     doCreatureAddHealth(cid,Health) 
  elseif getPlayerLevel(cid) < PLevel then 
     doPlayerSendCancel (cid, "You do not have the required level.") 
       doCreatureAddHealth(cid, -Health) 
end 
end 
return true 
end

just watch if by the <add your HP> and <shield ID> you have to put your own
anyways this is my first script
REP++


yesh!xD
:thumbup:
 
Last edited by a moderator:
PHP:
local ID = 1337 -- The ID of the item
local PLevel = 50 -- The level to use the item
local Health = 100 -- The amount of health to get when equiping the ID

function onUse(cid, item, fromPosition, itemEx, toPosition)
  if item.itemid == ID and if getPlayerLevel(cid) >= PLevel then
     doCreatureAddHealth(cid,Health)
  elseif getPlayerLevel(cid) < PLevel then
     doPlayerSendCancel (cid, "You do not have the required level.")
       doCreatureAddHealth(cid, -Health)
end
end
return true
end

I'm not sure if this works, but I think it will xD

It's easier to configurate and it's less text.

BTW. Can you do like I do with "-Health" ?
 
@Master-J
Good, but i bet it wont work like request.
Cuz its will heal player when using shield ;) He wants maximum hp increase.
I guess it must be movement and setCreatureMaxHealth(cid, health) but i cant script it.
 
Code:
local ID = 1337 -- The ID of the item 
local PLevel = 50 -- The level to use the item 
local Health = 100 -- The amount of health to get when equiping the ID 

function onUse(cid, item, fromPosition, itemEx, toPosition) 
  if item.itemid == ID and if getPlayerLevel(cid) >= PLevel then 
     setCreatureMaxHealth(cid, health) 
  elseif getPlayerLevel(cid) < PLevel then 
     doPlayerSendCancel (cid, "You do not have the required level.") 
       setCreatureMaxHealth(cid, health) 
end 
end 
return true 
end


like this? :P
 
Back
Top