Jump to content
Fajar

Check Item Before Entering Map

Recommended Posts

Root>resource>mapname>entry.lua
Use/change the below code to your own.
 

function check_can_enter_darkswamp( role, copy_mgr )
    local Num_1= CheckBagItem(role,0222)
    if Num_1 >= 1 then
        SystemNotice(role, "Please, remove [Snow Dragon Fruit] from your inventory!")    
        return 0
    end
    local Num_2= CheckBagItem(role,0223)
    if Num_2 >= 1 then
        SystemNotice(role, "Please, remove [Icespire Plum] from your inventory!")    
        return 0
    end
end



This will check player for items, if they got the item then they can't enter. If u dont want them to drop and enter while teleporting delay(if you got) then make sure, u make the item undroppable, meaning they will have to delete it to enter.

  • Like 1

Share this post


Link to post
Share on other sites

Hello @Fajar!

 

As @DangThao mentioned, there is function CheckBagItem(role, ItemID) which returns number of items with ID ItemID in role's inventory. You can use it in function check_can_enter_<mapname>(role, copymgr) which is located in server\resource\mapname\entry.lua

  • Like 2

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...