• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Need a movement script! (Click fountain at x lvl = access tiles)

Klank

Althea ¤ A New World Developer
Joined
Feb 21, 2008
Messages
1,113
Reaction score
705
Location
Norway
Hello.

I will just show you in picture.

When u click on statue you drink holy water. When drinken send green message: You drank some holy water, you can now enter energy zones.

And now you will be able to pass the gate. If you try to pass the gate without drinking from the fountain you will be pushed back and loose dmg. and send red message: You need some kind of protection to go through here. I can edit the script, but i can't make it :p
blabla.png
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPlayerStorageValue(cid, 12345) < 1 then
        setPlayerStorageValue(cid, 12345, 1)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You drank some holy water, you can now enter energy zones.")
    else
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have already received the permission to enter the energy zones.")
    end
    return true
end

Code:
function onStepIn(cid, item, position, fromPosition)
    if isPlayer(cid) and getPlayerStorageValue(cid, 12345) < 1 then
        doTeleportThing(cid, fromPosition)
        doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You need some kind of protection to go through here.")
        doCreatureAddHealth(cid, -100)
    end
end
 
Last edited:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPlayerStorageValue(cid, 12345) < 1 then
        setPlayerStorageValue(cid, 12345, 1)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You drank some holy water, you can now enter energy zones.")
    else
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have already received the permission to enter the energy zones.")
    end
    return true
end

Code:
function onStepIn(cid, item, position, fromPosition)
    if isPlayer(cid) and getPlayerStorageValue(cid, 12345) < 1 then
        doTeleportThing(cid, fromPosition)
        doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You need some kind of protection to go through here.")
        doCreatureAddHealth(cid, -100)
    end
end


Thank you! But im noobie in scripting, do i add first in action? and second in movement? and nothing in xml??
 
Thank you! But im noobie in scripting, do i add first in action? and second in movement? and nothing in xml??
Yes, first goes into actions and second one into movements. You need to register them in their XML as well.

actions.xml
Code:
<action actionid="XXXX" event="script" value="name.lua"/>
movements.xml
Code:
<movevent type="StepIn" actionid="XXXX" event="script" value="name.lua" />
 
Yes, first goes into actions and second one into movements. You need to register them in their XML as well.

actions.xml
Code:
<action actionid="XXXX" event="script" value="name.lua"/>
movements.xml
Code:
<movevent type="StepIn" actionid="XXXX" event="script" value="name.lua" />

Got it to work, thank you !
 
Back
Top