• 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 New scripter - what did I do wrong?

seba2632

life thug chosen my
Joined
Dec 27, 2011
Messages
426
Reaction score
153
Hello everyone.

I've recently started to try scripting a bit on a highexp server(Evolera.se), but I have reached an "wall".
I really can't get this script to work, and I can't see why. It is really annoying, and that's why I'm posting, I hope some of you guys can help me!

Basicly the script is:
Code:
function onStepIn(cid, item, position, fromPos, fromPosition)
local pos1 = {x=957, y=1078, z=7}
local pos2 = {x=965, y=1078, z=7}
local pos3 = {x=956, y=1087, z=7}
local pos4 = {x=965, y=1087, z=7}
if isPlayer(cid) then
    if getPlayerLevel(cid) <= 300000 then
           doPlayerSendTextMessage(cid,22,"You're between level 0 and 300k and have been set to the low level arena.")
           doTeleportThing(cid, pos1)
           doSendMagicEffect(pos1, 6)

    elseif getPlayerLevel(cid) > 300001 and < 6000000 then
          doPlayerSendTextMessage(cid,22,"You're between level 300k and 600k and have been set to the medium level arena")
          doTeleportThing(cid, pos2)
          doSendMagicEffect(pos2, 6)

    elseif getPlayerLevel(cid) > 600001 and < 9000000 then
          doPlayerSendTextMessage(cid,22,"You're between level 600k and 900k and have been set to the high level arena")
          doTeleportThing(cid, pos3)
          doSendMagicEffect(pos3, 6)

    elseif getPlayerLevel(cid) > 900001 then
           doPlayerSendTextMessage(cid,22,"You're between level 900k+ and have been set to the ultra level arena")
          doTeleportThing(cid, pos4)
          doSendMagicEffect(pos4, 6)
        end
    end
end

If you didn't figure it, it's an movement script where it should teleport you to 4 different places depending on you're level.
So yea, if any of you could tell me what I've done wrong, then that would be great!
 
Code:
function onStepIn(cid, item, position, fromPosition)
local pos1, pos2, pos3, pos4 = {x=957, y=1078, z=7}, {x=965, y=1078, z=7}, {x=956, y=1087, z=7}, {x=965, y=1087, z=7}
if isPlayer(cid) then
    if getPlayerLevel(cid) <= 300000 then
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You're between level 0 and 300k and have been set to the low level arena.")
        doTeleportThing(cid, pos1)
    elseif getPlayerLevel(cid) >= 300001 and getPlayerLevel(cid) <= 600000 then
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE,"You're between level 300k and 600k and have been set to the medium level arena")
        doTeleportThing(cid, pos2)
    elseif getPlayerLevel(cid) >= 600001 and getPlayerLevel(cid) <= 900000 then
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You're between level 600k and 900k and have been set to the high level arena")
        doTeleportThing(cid, pos3)
    elseif getPlayerLevel(cid) >= 900001 then
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You're between level 900k+ and have been set to the ultra level arena")
        doTeleportThing(cid, pos4)
        end
      
    doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
    end
end
 
i think was missing some lvls hehe
Code:
local pos1 = {x=957, y=1078, z=7}
local pos2 = {x=965, y=1078, z=7}
local pos3 = {x=956, y=1087, z=7}
local pos4 = {x=965, y=1087, z=7}

function onStepIn(cid, item, position, fromPos, fromPosition)
  if isPlayer(cid) then
      if getPlayerLevel(cid) <= 300000 then
        doPlayerSendTextMessage(cid,22,"You're between level 0 and 300k and have been set to the low level arena.")
        doTeleportThing(cid, pos1)
      elseif getPlayerLevel(cid) >= 300001 and getPlayerLevel(cid) <= 6000000 then
        doPlayerSendTextMessage(cid,22,"You're between level 300k and 600k and have been set to the medium level arena")
        doTeleportThing(cid, pos2)
      elseif getPlayerLevel(cid) >= 600001 and getPlayerLevel(cid) <= 9000000 then
        doPlayerSendTextMessage(cid,22,"You're between level 600k and 900k and have been set to the high level arena")
        doTeleportThing(cid, pos3)
      elseif getPlayerLevel(cid) >= 900001 then
        doPlayerSendTextMessage(cid,22,"You're between level 900k+ and have been set to the ultra level arena")
        doTeleportThing(cid, pos4)
      end
      doSendMagicEffect(getThingPos(cid), 6)
  end
  return true
end
 

Similar threads

Back
Top