Script !reward para server Endless

kyubinhok

Hellgrave Premium
Miembro
LV
6
 
Awards
6
Este script es totalmente funcional para el server
[13.11] Endless RL Custom [v1.6.0]
Funciona utilizando el comando !reward
Y al usarlo te da opciones para elegir por ejemplo
!reward wand
!reward rod
!reward axe
!reward club
!reward bow
!reward gloves

Los cuales son lasting exercise de 14400 cargas..
Tiene como condición ser nivel 100, pero esto lo pueden modificar a su gusto o quitar simplemente borrando la línea:


Código Lua:
local LAST_REWARD_TIME_STORAGE_KEY = 245147  -- Storage Unica

local rewardModal = TalkAction("!reward")
function rewardModal.onSay(player, words, param)
    if player:getStorageValue(LAST_REWARD_TIME_STORAGE_KEY) > 0 then
        player:sendTextMessage(MESSAGE_INFO_DESCR, "You already received your exercise weapon reward!")
        return false
    end

    local itemID = nil
    local itemName = ""

    if param == "rod" then
        itemID = 35289
        itemName = "Lasting exercise rod"
    elseif param == "wand" then
        itemID = 35290
        itemName = "Lasting exercise wand"
    elseif param == "glove" then
        itemID = 33332
        itemName = "Lasting exercise glove"
    elseif param == "sword" then
        itemID = 35285
        itemName = "Lasting exercise sword"
    elseif param == "axe" then
        itemID = 35286
        itemName = "Lasting exercise axe"
    elseif param == "club" then
        itemID = 35287
        itemName = "Lasting exercise club"
    elseif param == "bow" then
        itemID = 35288
        itemName = "Lasting exercise bow"
    else
        player:sendTextMessage(MESSAGE_INFO_DESCR, "Invalid choice. Usage: !reward rod, !reward wand, !reward glove, !reward sword, !reward axe, !reward club, or !reward bow")
        return false
    end

    local newItem = player:addItem(itemID, 1, false, 14400)
    if newItem then
        player:setStorageValue(LAST_REWARD_TIME_STORAGE_KEY, os.time())
        player:sendTextMessage(MESSAGE_INFO_DESCR, "You've received reward: " .. itemName .. "!")
    else
        player:sendTextMessage(MESSAGE_INFO_DESCR, "Failed to add item to inventory.")
    end

    return false
end

rewardModal:separator(" ")
rewardModal:register()

Este script no es una creación mía, fui apoyado por @Alex y por ChatGPT.. y después de muchos intentos lo logre hacer funcionar...
 

ext3

Miembro
LV
7
 
Awards
4
una pregunta y donde coloco el archivo lua o tengo el texto a algun archivo que ya este
 

kyubinhok

Hellgrave Premium
Miembro
LV
6
 
Awards
6
una pregunta y donde coloco el archivo lua o tengo el texto a algun archivo que ya este
Hola, en TalkActions en la carpeta players..
busca un archivo por ejemplo aol.lua,
hazle copia y a esa copia cambia el nombre a reward

Borra el contenido, pegas este script y listo
 

kyubinhok

Hellgrave Premium
Miembro
LV
6
 
Awards
6
Para ser más exacto la ruta donde debes poner tu reward.lua es:
Endless_Custom_v1.6.0/data-real-map/scripts/talkactions/players
 
Arriba