• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

[LUA] Zysens Scripts

Lua:
function onStepIn(cid, item, frompos, itemEx, topos)
local temple = { x = XXX, y = XXX, z = X }  ---- TEMPLE POS
        doPlayerSendTextMessage(cid,21,"Welcome back! You got full health and mana now!")
        doCreatureAddMana(cid,XXX)  ---- MANA ADD
        doCreatureAddHealth(cid,XXX) ---- HEALTH ADD
        return TRUE
end

Some fixing for you.

1. make locals that don't require stuff like (cid) etc.. ABOVE the function to make it more stable.

I.e.
Lua:
local temple = {x=1,y=1,z=7}
function onStepIn()

2. If you don't call a local, as the local temple in this case, don't make it.
If you want to use it you need to use it like this.

Lua:
local temple = { x = XXX, y = XXX, z = X }  ---- TEMPLE POS

function onStepIn(cid, item, frompos, itemEx, topos)
    doTeleportThing(cid,temple)
    doPlayerSendTextMessage(cid,27,'You have been teleported to temple.')
end

3. Work on your tabbing, if you make it like this:

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
        doPlayerSendTextMessage(cid,21,"Aaaah...")
    if item.itemid == XXX then
    getCreatureMaxHealth(cid)
    getCreatureMaxMana(cid)
    end
    return TRUE
end

it's hard to read, but if you make it like this:

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.itemid == XXX then
        doPlayerSendTextMessage(cid,21,"Aaaah...")
        getCreatureMaxHealth(cid)
        getCreatureMaxMana(cid)
    end
    return TRUE
end

4. there is no need to check for the itemid of the item, unless you make the script execute by uid/aid.

That's for now,
Keep on scripting.
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.itemid == XXX then
        doPlayerSendTextMessage(cid,21,"You are a ghost now.")
    getPlayerGhostAccess(cid)
end
    return TRUE
end
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition) 
    if item.itemid == 1378 then 
        doPlayerSendTextMessage(cid,21,"You gained full HP and MP!") 
        getCreatureMaxHealth(cid)
        getCreatureMaxMana(cid)
end 
    return TRUE 
end
 
Last edited:
New script release:Hope this works.Logout message:




Code:
function onLogout(cid)
		doPlayerSendTextMessage(cid,21,"Good bye!")
	doSendMagicEffect(pos, type[, player])
end
	return TRUE
end



Regards,
Zysen

wtf, how is he going to see the message if he's logging out? o_O
 
Hes not, Other people will see it if he was on there screen..
 
Back
Top