freaked1
Active Member
Hello again!
EDIT: TFS 1.1
I stumble upon another problem with getting a lua script to work for me.
I want the script to check if you have anything equipped (except backpack).
If you have something equipped in either slot for example ring, amulet or weapon/shield you can't use the item to increase your max health/mana.
Script:
I have not managed to get the right, tried
"if getPlayerSlotItem(cid, 5) ==" I don't know if 5 is weapon slot or what and I think that requires a specific itemID. I want it to check if you have any item what so ever in either slot except backpack slot and if you have it will not continue.
Sorry if this is posted at the wrong place and should be posted under requests, I couldn't tell as it is kind of fits on both places.
Thank you so much in advance!
EDIT: TFS 1.1
I stumble upon another problem with getting a lua script to work for me.
I want the script to check if you have anything equipped (except backpack).
If you have something equipped in either slot for example ring, amulet or weapon/shield you can't use the item to increase your max health/mana.
Script:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local player = Player(cid)
local config = {
addmana=20,
addhealth=20,
}
player:setMaxHealth(player:getMaxHealth()+config.addhealth)
player:setMaxMana(player:getMaxMana()+config.addmana)
doPlayerSendTextMessage(cid, 22, "Your max health has been increased by "..config.addhealth.." and your max mana by "..config.addmana.."!")
doRemoveItem(item.uid,1)
return TRUE
end
I have not managed to get the right, tried
"if getPlayerSlotItem(cid, 5) ==" I don't know if 5 is weapon slot or what and I think that requires a specific itemID. I want it to check if you have any item what so ever in either slot except backpack slot and if you have it will not continue.
Sorry if this is posted at the wrong place and should be posted under requests, I couldn't tell as it is kind of fits on both places.
Thank you so much in advance!
Last edited: