-- Hello friend can you help me to fix this script??? i made this script to change max health player gain after EQUIP a armor, but this send this message when i put on armor slot, and dont add this to armor slot:
-- Message error on GAME after equip item:
Code:you cannot dress this objecte there
-- See the MOVEMENTS:
Lua:<movevent type="Equip" itemid="2508" slot="armor" event="script" value="kina_arm.lua" /> <movevent type="DeEquip" itemid="2508" slot="armor" event="script" value="kina_arm.lua" />
-- This my script:
Lua:local config = { item1 = 2508 -- ID of armor } function onEquip(cid, item, slot) if getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid == config.item then doPlayerSendTextMessage(cid, 25, "Health changed...") setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + 500) setCreatureMaxMana(cid, getCreatureMaxMana(cid) + 300) end end function onDeEquip(cid, item, slot) if getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid == config.item then doPlayerSendTextMessage(cid, 25, "Health changed...") setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - 500) setCreatureMaxMana(cid, getCreatureMaxMana(cid) - 300) end end
-- This my item.xml
Lua:<item id="2508" article="a" name="native armor"> <attribute key="weight" value="5000"/> <attribute key="armor" value="1"/> <attribute key="slotType" value="body"/> </item>
-- Can you solve this for me??? I need this for urgence... many thx for you, i'm will greatfull...
Return TRUE
In order to fix your Script, you need to addotherwise it will cancel the script when you try and equip it.Code:Return TRUE
return TRUE
that function doesnt work yet;p@nilson, getweapontype was replaced with
getPlayerWeapon(cid[, ignoreAmmo])
use that.
you cannot dress this objecte there
<movevent type="Equip" itemid="2508" slot="armor" event="script" value="kina_arm.lua" />
<movevent type="DeEquip" itemid="2508" slot="armor" event="script" value="kina_arm.lua" />
local config = {
item1 = 2508 -- ID of armor
}
function onEquip(cid, item, slot)
if getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid == config.item then
doPlayerSendTextMessage(cid, 25, "Health changed...")
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + 500)
setCreatureMaxMana(cid, getCreatureMaxMana(cid) + 300)
end
end
function onDeEquip(cid, item, slot)
if getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid == config.item then
doPlayerSendTextMessage(cid, 25, "Health changed...")
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - 500)
setCreatureMaxMana(cid, getCreatureMaxMana(cid) - 300)
end
end
<item id="2508" article="a" name="native armor">
<attribute key="weight" value="5000"/>
<attribute key="armor" value="1"/>
<attribute key="slotType" value="body"/>
</item>
Reward System : When we kill someone, we gain a BANANA.
Type Of Script : Action?
Priority : HIGH|
Reason: Because I cannot open my server without this script ;P
Public
Script from Jose Didn't work. Go see page 2-3 for his script
function onDeath(cid, corpse, killer)
if isPlayer(killer) == TRUE then
local item = doPlayerAddItem(killer, 2676, 1)
end
return TRUE
end
-- Hello friend can you help me to fix this script??? i made this script to change max health player gain after EQUIP a armor, but this send this message when i put on armor slot, and dont add this to armor slot:
-- Message error on GAME after equip item:
Code:you cannot dress this objecte there
-- See the MOVEMENTS:
Lua:<movevent type="Equip" itemid="2508" slot="armor" event="script" value="kina_arm.lua" /> <movevent type="DeEquip" itemid="2508" slot="armor" event="script" value="kina_arm.lua" />
-- This my script:
Lua:local config = { item1 = 2508 -- ID of armor } function onEquip(cid, item, slot) if getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid == config.item then doPlayerSendTextMessage(cid, 25, "Health changed...") setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + 500) setCreatureMaxMana(cid, getCreatureMaxMana(cid) + 300) end end function onDeEquip(cid, item, slot) if getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid == config.item then doPlayerSendTextMessage(cid, 25, "Health changed...") setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - 500) setCreatureMaxMana(cid, getCreatureMaxMana(cid) - 300) end end
-- This my item.xml
Lua:<item id="2508" article="a" name="native armor"> <attribute key="weight" value="5000"/> <attribute key="armor" value="1"/> <attribute key="slotType" value="body"/> </item>
-- Can you solve this for me??? I need this for urgence... many thx for you, i'm will greatfull...
function onEquip(cid, item, slot)
doPlayerSendTextMessage(cid, 25, "Health changed...")
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + 500)
setCreatureMaxMana(cid, getCreatureMaxMana(cid) + 300)
return TRUE
end
function onDeEquip(cid, item, slot)
doPlayerSendTextMessage(cid, 25, "Health changed...")
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - 500)
setCreatureMaxMana(cid, getCreatureMaxMana(cid) - 300)
return TRUE
end
@up i notice you had difficulty so ill explain how to do it.
Heres all you were really missing.
Code:function doPlayerAddSummon(cid, name, pos) local MyCreature = doSummonCreature(name, pos) doConvinceCreature(cid, MyCreature) end
And
Code:doPlayerAddSummon(cid, param, getCreaturePosition(cid))
Heres the full script:
Code:function doPlayerAddSummon(cid, name, pos) local MyCreature = doSummonCreature(name, pos) doConvinceCreature(cid, MyCreature) end function onSay(cid, words, param, channel) local level = 30 local mana = 200 local vocsCanUse = {1, 2, 3, 4, 5, 6, 7,8} local condition = CONDITION_DRUNK local canBeSummoned = {"Dog", "Troll", "Bug", "Fire Devil", "Fire Elemental"} if getPlayerLevel(cid) < level then doPlayerSendCancel(cid, "Your level is too low.") return TRUE end if getCreatureMana(cid) < mana then doPlayerSendCancel(cid, "You do not have enough mana.") return TRUE end if(not isInArray(vocsCanUse, getPlayerVocation(cid))) then doPlayerSendCancel(cid, "Your vocation cannot use this spell.") return TRUE end if getCreatureCondition(cid, condition) == FALSE then doPlayerSendCancel(cid, "You need to be drunked to use this spell.") return TRUE end if(not isInArray(canBeSummoned, param)) then doPlayerSendCancel(cid, "You cannot summon this creature.") return TRUE end doPlayerAddSummon(cid, param, getCreaturePosition(cid)) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED) return TRUE end
<movevent event="Equip" itemid="2123" slot="ring" level="8" function="onEquipItem" script="cidade/mana ring.lua" />
<movevent event="DeEquip" itemid="2123" slot="ring" function="onDeEquipItem" script="cidade/mana ring.lua" />
local addmana = getCreatureMaxMana(cid)*2.5
local submana = getCreatureMaxMana(cid)/2.5
function onEquip(cid, item, slot)
setCreatureMaxMana(cid, addmana)
end
function onDeEquip(cid, item, slot)
setCreatureMaxMana(cid, submana)
end
When i try to put the ring on ring slot it says:
You cannot dress this object here.
<item id="2179" article="a" name="gold ring">
<attribute key="weight" value="100"/>
<attribute key="slotType" value="ring"/>
</item>
<item id="2179" article="a" name="gold ring">
<attribute key="weight" value="100"/>
<attribute key="slotType" value="ring"/>
<attribute key="maxmanapercent" value="125"/>
</item>
<movevent type="Equip" itemid="2179" slot="ring" event="function" value="onEquipItem"/>
<movevent type="DeEquip" itemid="2179" slot="ring" event="function" value="onDeEquipItem"/>
just add a storage value, if the storage value is maxed over 2 or so..then script returns false?