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

Lua movements, my event castle.lua

Wicked Girl

New Member
Joined
Aug 26, 2016
Messages
15
Reaction score
0
61466 < when someone step in that movements of actions teleport a player to a place that I want.
movements
Code:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
    if item.actionid == 61465 then
        if realCastle.isOpen() then
            if getPlayerGuildId(cid) > 0 then
                if getPlayerLevel(cid) >= 250 then
                    doSendMagicEffect(getThingPos(cid),CONST_ME_MAGIC_BLUE)
                else
                    doPlayerSendCancel(cid,"Somente jogadores level 250+ podem tentar dominar o castelo.")
                    doTeleportThing(cid,fromPosition)
                    doSendMagicEffect(fromPosition,CONST_ME_POFF)
                end
            else
                doPlayerSendCancel(cid,"Somente jogadores com guild podem tentar dominar o castelo.")
                doTeleportThing(cid,fromPosition)
                doSendMagicEffect(fromPosition,CONST_ME_POFF)
            end
        else
            doPlayerSendCancel(cid,"O castelo não está aberto para invasões.")
            doTeleportThing(cid,fromPosition)
            doSendMagicEffect(fromPosition,CONST_ME_POFF)
        end
    elseif item.actionid == 61466 then
        if not realCastle.isOpen() then
            if realCastle.isDominating(cid) then
                doSendMagicEffect(getThingPos(cid),CONST_ME_MAGIC_BLUE)
                doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"Bem vindo ao Castle24WAR!")
            else
                doPlayerSendCancel(cid,"Somente membros da guild dominante podem entrar.")
                doTeleportThing(cid,{x = toPosition.x, y = toPosition.y + 2, z = toPosition.z})
                doSendMagicEffect({x = toPosition.x, y = toPosition.y + 2, z = toPosition.z},6)
            end
        else
            doPlayerSendCancel(cid,"Não é permitido entrar no castelo enquanto as guild estão batalhando pelo seu domínio.")
            doTeleportThing(cid,{x = toPosition.x, y = toPosition.y + 2, z = toPosition.z})
            doSendMagicEffect({x = toPosition.x, y = toPosition.y + 2, z = toPosition.z},6)
        end
    end
    return true
end
 
Cant understand what you want completely...
You say the id is 61466 but in the code it says:
Code:
if item.actionid == 61465 then


Also, you might want to show us what this is about
Code:
if realCastle.isOpen() then

step 1) learn english

Code:
if not step 1 then
goto anotherForum
end
 
ooohhh GOD get now decide if a monster go over it takes the monster too, and that's bad would have let player just go over?

[30/8/2016 2:26:16] [Error - MoveEvents Interface]
[30/8/2016 2:26:16] data/movements/scripts/events/realCastle.lua:eek:nStepIn
[30/8/2016 2:26:16] Description:
[30/8/2016 2:26:16] (internalGetPlayerInfo) Player not found when requesting player info #11


[30/8/2016 2:32:33] [Error - MoveEvents Interface]
[30/8/2016 2:32:33] data/movements/scripts/events/realCastle.lua:onStepIn
[30/8/2016 2:32:33] Description:
[30/8/2016 2:32:33] (luaDoPlayerSendCancel) Player not found

Code:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
    if item.actionid == 61465 then
        if realCastle.isOpen() then
            if getPlayerGuildId(cid) > 0 then
                if getPlayerLevel(cid) >= 250 then
                    doSendMagicEffect(getThingPos(cid),CONST_ME_MAGIC_BLUE)
                else
                    doPlayerSendCancel(cid,"Somente jogadores level 250+ podem tentar dominar o castelo.")
                    doTeleportThing(cid,fromPosition)
                    doSendMagicEffect(fromPosition,CONST_ME_POFF)
                end
            else
                doPlayerSendCancel(cid,"Somente jogadores com guild podem tentar dominar o castelo.")
                doTeleportThing(cid,fromPosition)
                doSendMagicEffect(fromPosition,CONST_ME_POFF)
            end
        else
            doPlayerSendCancel(cid,"O castelo não está aberto para invasões.")
            doTeleportThing(cid,fromPosition)
            doSendMagicEffect(fromPosition,CONST_ME_POFF)
        end
    elseif item.actionid == 61466 then
        if not realCastle.isOpen() then
            if realCastle.isDominating(cid) then
                doSendMagicEffect(getThingPos(cid),CONST_ME_MAGIC_BLUE)
                doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"Bem vindo ao Castle24WAR!")
            else
                doPlayerSendCancel(cid,"Somente membros da guild dominante podem entrar.")
                doTeleportThing(cid,{x = 160, y = 54, z = 7})
                doSendMagicEffect({x = 160, y = 54, z = 7},6)
            end
        else
            doPlayerSendCancel(cid,"Não é permitido entrar no castelo enquanto as guild estão batalhando pelo seu domínio.")
            doTeleportThing(cid,{x = toPosition.x, y = toPosition.y + 2, z = toPosition.z})
            doSendMagicEffect({x = toPosition.x, y = toPosition.y + 2, z = toPosition.z},6)
        end
    end
    return true
end
 
Last edited:
Back
Top