• 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 Enchanting Altar's Help ME!!

Darkstox

Been Blazing
Joined
Sep 26, 2008
Messages
37
Reaction score
2
ok so this is the error im reciving..

TFS altar error.jpg

Here is the lua..

Code:
function onStepIn(cid, item, pos)
 
    local ice = {x=32193, y=31419, z=2}
    local earth = {x=32974, y=32224, z=7}
    local fire = {x=32925, y=32342, z=15}
    local energy = {x=33060, y=32711, z=5}
   
    if getPlayerLookDir(cid) == 0 then
        newdir = 2
        newdir2 = 2
    elseif getPlayerLookDir(cid) == 1 then
        newdir = 3
        newdir2 = 3
    elseif getPlayerLookDir(cid) == 2 then
        newdir = 0
        newdir2 = 0
    else
        newdir = 1
        newdir2 = 1
    end
 
    if item.actionid == 7841 then
        if getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 6 and getPlayerLevel(cid) >= 30 and isPremium(cid) == TRUE then
            doTeleportThing(cid,ice)
            doSendMagicEffect(ice,10)
            setPlayerStorageValue(cid, 15121, 1)
        else
            doCreatureSay(cid, "Only Premium Druids of level 30 or higher are able to enter this portal", TALKTYPE_ORANGE_1)
            doMoveCreature(cid, newdir)
            doMoveCreature(cid, newdir2)
            doSendMagicEffect(getCreaturePosition(cid),10)
    end
    elseif item.actionid == 7842 then
        if getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 6 and getPlayerLevel(cid) >= 30 and isPremium(cid) == TRUE then
            doTeleportThing(cid,earth)
            doSendMagicEffect(earth,10)
            setPlayerStorageValue(cid, 15133, 1)
        else
            doCreatureSay(cid, "Only Premium Druids of level 30 or higher are able to enter this portal", TALKTYPE_ORANGE_1)
            doMoveCreature(cid, newdir)
            doMoveCreature(cid, newdir2)
            doSendMagicEffect(getCreaturePosition(cid),10)
    end
    elseif item.actionid == 7843 then
        if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 5 and getPlayerLevel(cid) >= 30 and isPremium(cid) == TRUE then
            doTeleportThing(cid,fire)
            doSendMagicEffect(fire,10)
            setPlayerStorageValue(cid, 15157, 1)
        else
            doCreatureSay(cid, "Only Premium Sorcerers of level 30 or higher are able to enter this portal", TALKTYPE_ORANGE_1)
            doMoveCreature(cid, newdir)
            doMoveCreature(cid, newdir2)
            doSendMagicEffect(getCreaturePosition(cid),10)
    end
    elseif item.actionid == 7844 then
            if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 5 and getPlayerLevel(cid) >= 30 and isPremium(cid) == TRUE then
            doTeleportThing(cid,energy)
            doSendMagicEffect(energy,10)
            setPlayerStorageValue(cid, 15145, 1)
        else
            doCreatureSay(cid, "Only Premium Sorcerers of level 30 or higher are able to enter this portal", TALKTYPE_ORANGE_1)
            doMoveCreature(cid, newdir)
            doMoveCreature(cid, newdir2)
            doSendMagicEffect(getCreaturePosition(cid),10)
    end
    end
end

And here is what i got in movements XML...

<movevent type="StepIn" fromaid="7841" toaid="7844" event="script" value="alters/alterstpsvar.lua" />

i've tried a couple different things but this error is still spamming my console >.<
somebody please help me, any help will be appreciated!
 
Code:
local t = {
   [7841] = {{x = 32193, y = 31419, z = 2}, {2, 6}, 30, "druids and elder druids"},
   [7842] = {{x = 32974, y = 32224, z = 7}, {2, 6}, 30, "druids and elder druids"},
   [7843] = {{x = 32925, y = 32342, z = 15}, {1, 5}, 30, "sorcerers and master sorcerers"},
   [7844] = {{x = 33060, y = 32711, z = 5}, {1, 5}, 30, "sorcerers and master sorcerers"}
}

function onStepIn(cid, item, position, fromPosition)
local v = t[item.actionid]
if isPlayer(cid) then
    if isInArray(v[2], getPlayerVocation(cid)) and getPlayerLevel(cid) >= v[3] and isPremium(cid) then
        doTeleportThing(cid, v[1])
        doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
    else
        doCreatureSay(cid, "Only " .. v[4] .. " of level " .. v[3] .. " or higher are able to enter this portal", TALKTYPE_ORANGE_1)
        doTeleportThing(cid, fromPosition)
        doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
        end
    end
end
 
ok i'm getting this error now after changing to your script, ty btw!

TFS altar error.jpg

Code:
local t = {
  [7841] = {{x = 32193, y = 31419, z = 2}, {2, 6}, 30, "druids and elder druids"},
  [7842] = {{x = 32974, y = 32224, z = 7}, {2, 6}, 30, "druids and elder druids"},
  [7843] = {{x = 32925, y = 32342, z = 15}, {1, 5}, 30, "sorcerers and master sorcerers"},
  [7844] = {{x = 33060, y = 32711, z = 5}, {1, 5}, 30, "sorcerers and master sorcerers"}
}
 
function onStepIn(cid, item, position, fromPosition)
    end<!-- this was missing :p -->
 
local v = t[item.actionid]
if isPlayer(cid) then
    if isInArray(v[2], getPlayerVocation(cid)) and getPlayerLevel(cid) >= v[3] and isPremium(cid) then
        doTeleportThing(cid, v[1])
        doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
    else
        doCreatureSay(cid, "Only " .. v[4] .. " of level " .. v[3] .. " or higher are able to enter this portal", TALKTYPE_ORANGE_1)
        doTeleportThing(cid, fromPosition)
        doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
    end
end
 

Similar threads

Back
Top Bottom