Itutorial
Legendary OT User
- Joined
- Dec 23, 2014
- Messages
- 2,461
- Solutions
- 68
- Reaction score
- 1,123
@whitevo
This one can be configured pretty easily.... You will of course have to make a creature script... 1 for every NPC running this so you can use the same data like 0x00
This one can be configured pretty easily.... You will of course have to make a creature script... 1 for every NPC running this so you can use the same data like 0x00
Code:
local adv_config = {
["text1"] = {
storages = {[1] = {storage = 40000, value = 1, data = 0x00, text = "text1"}, [2] = {storage = 40001, value = 1, data = 0x01, text = "text2"}},
["text2"] = {
storages = {[1] = {storage = 40000, value = 2, data = 0x10, text = "text1"}, [2] = {storage = 40001, value = 2, data = 0x11, text = "text2"}}
}}}
local WINDOW = ModalWindow(0xFF, "NPC", "msg")
if msg == "text1" then
EXECUTE = adv_config[msg]
if not EXECUTE then
return true
end
for i = 1, #EXECUTE.storages[i] do
if getPlayerStorageValue(cid, EXECUTE.storages[i].storage) == EXECUTE.storages[i].value then
WINDOW:addChoice(EXECUTE.storages[i].data, EXECUTE.storages[i].text)
end
end
WINDOW:sendToPlayer(cid)
end