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

login.lua change some things.

WaderoS

New Member
Joined
Nov 22, 2008
Messages
98
Reaction score
1
Hello. I need to help with script to login.lua.
I want this:
When player on mainland loss lvl to 5 then he "rook himself" so he must has all what SAMPLE ROOK has got in his statistics.

I try to write this alone.... but i can't


Code:
function onLogin(cid)
if getPlayerLevel(cid) < 6
else getPlayerVocation(cid) > 0
then doPlayerSetTown(cid, 3)
doPlayerSetVocation(cid, 0)

I must do all like mana,hp etc or is it one line to copy SAMPLE ROOK?

Please, help me ; )
 
login2.lua

PHP:
function onLogin(cid)
if getPlayerLevel(cid) < 6 then
doTeleportThing(cid, {x=0,y=0,z=0})
doPlayerSetTown(cid, 3)
doPlayerSetVocation(cid, 0)
setPlayerPromotionLevel(cid, 0)
end


in creaturescripts.xml before </creaturescripts>

<event type="login" name="login2" event="script" value="login2.lua"/>


not tested, should work

@edit if you want to delete all items who player have add it to login2.lua before "end"

PHP:
helmet = getPlayerSlotItem(cid, 1).itemid
armor = getPlayerSlotItem(cid, 2).itemid
legs = getPlayerSlotItem(cid, 4).itemid
boots = getPlayerSlotItem(cid, 5).itemid
left = getPlayerSlotItem(cid, 6).itemid
right = getPlayerSlotItem(cid, 7).itemid
amulet = getPlayerSlotItem(cid, 8).itemid
ring = getPlayerSlotItem(cid, 9).itemid
ammo = getPlayerSlotItem(cid, 10).itemid

doRemoveItem(getPlayerSlotItem(cid, 1).uid)
doRemoveItem(getPlayerSlotItem(cid, 4).uid)
doRemoveItem(getPlayerSlotItem(cid, 7).uid)
doRemoveItem(getPlayerSlotItem(cid, 8).uid)
doRemoveItem(getPlayerSlotItem(cid, 5).uid)
doRemoveItem(getPlayerSlotItem(cid, 6).uid)
doRemoveItem(getPlayerSlotItem(cid, 2).uid)
doRemoveItem(getPlayerSlotItem(cid, 9).uid)
doRemoveItem(getPlayerSlotItem(cid, 3).uid)
doRemoveItem(getPlayerSlotItem(cid, 10).uid)
 
Back
Top