Code:
local stats = {
[1] = {name = 'test 1'},
[2] = {name = 'test 2'}
}
function onSay(player, words, param)
local window = ModalWindow { title = 'welcome', message = 'test' }
for i = 1, #stats do
window:addChoice(stats.name)
end
window:addButton('Okey', (
function(button, choice)
if choice.id == 1 then
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "ssss.")
end
if choice.id == 2 then
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "ssss")
end
end
)
)
window:setDefaultEnterButton('Okey')
window:addButton('Close')
window:setDefaultEscapeButton('Close')
window:sendToPlayer(player)
return false
end
I have a doubt I would like that every time I choose an option it always comes back to the initial january only comes out when the player clicks the exit