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

Solved Help adding script into actions.xml

Cris2387

Member
Joined
Dec 30, 2013
Messages
177
Reaction score
9
Hello i want to add a level system like a door that only allows players with a certain level or + to pass and i wanted to tested but i dont know how to add the script to the actions.xml lol xD this is my script
Code:
-- level doors based on actionId
-- to make door for level x create door on map and set its actionid to x+1000

function onUse(cid, item, frompos, item2, topos)
   reqlevel = item.actionid - 1000   -- actionids below 100 are reserved

   if reqlevel > 0 then
     if getPlayerLevel(cid) >= reqlevel then
       pos = getPlayerPosition(cid)

       if pos.x == topos.x then
         if pos.y < topos.y then
           pos.y = topos.y + 1
         else
           pos.y = topos.y - 1
         end
       elseif pos.y == topos.y then
         if pos.x < topos.x then
           pos.x = topos.x + 1
         else
           pos.x = topos.x - 1
         end
       else
         doPlayerSendTextMessage(cid,22,'Por favor, fique em frente da porta.')
         return 1
       end

       doTeleportThing(cid,pos)
       doSendMagicEffect(topos,12)
     else
       doPlayerSendTextMessage(cid,22,'Voce precisa ' .. reqlevel .. ' para passar esta porta.')
     end
     return 1
   else
     return 0
   end
end
and i was thinking maybe putting like a door for level 3000 thats why i need this script, thank you!
 
Which server do you use? Most server datapacks already have this by default in doors.lua.
If you don't have it you can add it with the door itemid in actions.xml.
 
Back
Top