Jump to content
  • 0

Ayuda Eliminar Objetos


Question

Posted

Buenos Dias,

Me pueden ayudar por favor En una Quest Que funcione en un NPC para eliminar Objetos que no se puedan eliminar en inventario

Tambien me gustar铆a un sistema que pueda agregar un bot贸n para eliminar Objetos

Gracias por su ayuda quien me ayude馃憤馃徎

3 answers to this question

Recommended Posts

  • 0
Posted

--Discord: ReuS#0308 ----
quest eliminar_objetos begin
聽聽 聽state start begin
聽聽 聽
聽聽 聽聽聽 聽when 9006.take begin
聽聽 聽聽聽 聽say_title("Eliminar objetos")
聽聽 聽聽聽 聽say("Deseas eliminar este objeto?")
聽聽 聽聽聽 聽local reus = item.get_vnum()
聽聽 聽聽聽 聽local reus1 = item.get_count(reus)
聽聽 聽聽聽 聽local reus2 = ("Eliminar objeto","Eliminar todos los objetos iguales","Cancelar")
聽聽 聽聽聽 聽聽聽 聽if reus2 == 1 then
聽聽 聽聽聽 聽聽聽 聽聽聽 聽item.remove()
聽聽 聽聽聽 聽聽聽 聽聽聽 聽chat("Has eliminado el item satisfactoriamente")
聽聽 聽聽聽 聽聽聽 聽end
聽聽 聽聽聽 聽聽聽 聽elseif reus2 == 2 then
聽聽 聽聽聽 聽聽聽 聽聽聽 聽pc.remove_item(reus,reus1)
聽聽 聽聽聽 聽聽聽 聽聽聽 聽chat("Has eliminado los objetos satisfactoriamente")
聽聽 聽聽聽 聽聽聽 聽end
聽聽 聽聽聽 聽end
聽聽 聽end
end

  • 0
Posted
On 11/7/2022 at 8:50 AM, Acer said:

Buenos Dias,

Me pueden ayudar por favor En una Quest Que funcione en un NPC para eliminar Objetos que no se puedan eliminar en inventario

Tambien me gustar铆a un sistema que pueda agregar un bot贸n para eliminar Objetos

Gracias por su ayuda quien me ayude馃憤馃徎

# Script de NPC para la misi贸n de eliminaci贸n de objetos

def onSelectItem(itemIndex):
聽 聽 # Verifica si el objeto es un objeto no eliminable
聽 聽 item = player.GetItem(itemIndex)
聽 聽 if item.IsRemovable() == False:
聽 聽 聽 聽 # Elimina el objeto del inventario del jugador
聽 聽 聽 聽 player.RemoveItem(itemIndex)
聽 聽 聽 聽 # Muestra un mensaje al jugador indicando que el objeto ha sido eliminado
聽 聽 聽 聽 player.ChatSay("Objeto eliminado.")
聽 聽 else:
聽 聽 聽 聽 # Muestra un mensaje al jugador indicando que el objeto no puede ser eliminado
聽 聽 聽 聽 player.ChatSay("Este objeto no puede ser eliminado.")

# Agrega la funci贸n onSelectItem al di谩logo del NPC
AddDialog("Selecciona un objeto para eliminar", onSelectItem)
# Funci贸n para eliminar objetos
def onClickRemoveItemButton(itemIndex):
    # Verifica si el objeto es un objeto no eliminable
    item = player.GetItem(itemIndex)
    if item.IsRemovable() == False:
        # Elimina el objeto del inventario del jugador
        player.RemoveItem(itemIndex)
        # Muestra un mensaje al jugador indicando que el objeto ha sido eliminado
        player.ChatSay("Objeto eliminado.")
    else:
        # Muestra un mensaje al jugador indicando que el objeto no puede ser eliminado
        player.ChatSay("Este objeto no puede ser eliminado.")

# Agrega el bot贸n de eliminar objeto al inventario
player.AddInventoryButton("Eliminar objeto", onClickRemoveItemButton)

Join the conversation

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

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

This site uses cookies to enhance your browsing experience and provide relevant content. By continuing to browse, you agree to our We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. and Terms of Use. For more information on how we protect your data, please check our Privacy Policy.