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

Solved Movement and hp bar Not working

TomBartezz

Member
Joined
May 29, 2016
Messages
159
Reaction score
17
I have a very confusing movement.lua
This one works
Code:
       <movevent type="Equip" itemid="10032" slot="ring" function="onEquipItem" script="reborn100eq.lua"/>
    <movement type="DeEquip" itemid="10032" event="function" value="onDeEquipItem"/>

This one does not work
Code:
       <movevent type="Equip" itemid="2086" slot="ring" function="onEquipItem" script="reborn100eq.lua"/>
    <movement type="DeEquip" itemid="2086" event="function" value="onDeEquipItem"/>
Both is the same scripts

Items.xml
Code:
    <item id="2086" article="a" name="Human Ring">
        <attribute key="magiclevelpoints" value="30" />
        <attribute key="absorbPercentall" value="1" />
        <attribute key="skillsword" value="5" />
        <attribute key="skillaxe" value="5" />
        <attribute key="slotType" value="ring" />
        <attribute key="skilldist" value="5" />
        <attribute key="skillshield" value="5" />
        <attribute key="showattributes" value="1" />
        <attribute key="weight" value="100" />
    </item>

    <item id="10032" article="a" name="Monster Ring">
        <attribute key="magiclevelpoints" value="50" />
        <attribute key="absorbPercentall" value="2" />
        <attribute key="skillsword" value="5" />
        <attribute key="skillaxe" value="5" />
        <attribute key="skilldist" value="5" />
        <attribute key="skillshield" value="5" />
        <attribute key="slotType" value="ring" />
        <attribute key="showattributes" value="1" />
        <attribute key="weight" value="100" />
    </item>
 
Code:
function onEquip(cid, item, slot)
if getPlayerSlotItem(cid, CONST_SLOT_HEAD).itemid == PLACE_ID and getPlayerStorageValue(cid, 4500) >= 100 then
return true
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You must be Prestige 100 or higher to equip this.")
return false
end
end
 
Code:
function onEquip(cid, item, slot)
if getPlayerSlotItem(cid, CONST_SLOT_HEAD).itemid == PLACE_ID and getPlayerStorageValue(cid, 4500) >= 100 then
return true
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You must be Prestige 100 or higher to equip this.")
return false
end
end
Thanks but this code is also for tfs 0.3.6 and it will have the attributes working right? Btw would i have to change head to ring? And how would it look in movements.xml?
 
Thanks but this code is also for tfs 0.3.6 and it will have the attributes working right? Btw would i have to change head to ring? And how would it look in movements.xml?
This code is going to work for 0.3.6.

Change head to ring, and this is what you want to be using
Code:
    <movevent event="Equip" itemid="127" function="onEquipItem" slot="ring" script="destination.lua"/>
    <movevent event="DeEquip" itemid="127" function="onDeEquipItem" slot="ring" script="destination.lua"/>

@Edit
Had to re-edit the post, use that line. @TomBartezz
 
This code is going to work for 0.3.6.

Change head to ring, and this is what you want to be using
Code:
    <movevent event="Equip" itemid="127" function="onEquipItem" slot="ring" script="destination.lua"/>
    <movevent event="DeEquip" itemid="127" function="onDeEquipItem" slot="ring" script="destination.lua"/>

@Edit
Had to re-edit the post, use that line. @TomBartezz
Thanks! I will try this tommorow
 
This code is going to work for 0.3.6.

Change head to ring, and this is what you want to be using
Code:
    <movevent event="Equip" itemid="127" function="onEquipItem" slot="ring" script="destination.lua"/>
    <movevent event="DeEquip" itemid="127" function="onDeEquipItem" slot="ring" script="destination.lua"/>

@Edit
Had to re-edit the post, use that line. @TomBartezz
So I've went all this time thinking that you couldn't add a script to items without attributes messing up?
gg
/shutdown life
 
So I've went all this time thinking that you couldn't add a script to items without attributes messing up?
gg
/shutdown life
Every one of my attempts have stopped special attributes from working.
increased hp%
regen
speed
et cetera
All of these attributes from items.xml typically break on my server if you use a custom script in movements.xml for the item.
I'm aware that this can be fixed in sources somehow, but I've just learned to live with it.
 
Back
Top