• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Modal Window

nevix

Tunzodus.net
Joined
Mar 31, 2010
Messages
356
Reaction score
62
Location
Lithuanian
Hello, I present pretty usefull tool.


cEREkip.png



You can travel whatever you want :)



Creature scripts:

Code:
<event type="modalwindow" name="Destination" script="my scripts/homeme.lua"/>


create folder "my scripts" and homeme.lua file

Code:
function onModalWindow(cid, modalWindowId, buttonId, choiceId)

if modalWindowId == 2 then


local player = Player(cid)
local thais = {x = 32345, y = 32223, z = 7}
local carlin = {x = 32336, y = 31784, z = 7}
local edron = {x = 33172, y = 31766, z = 6}
local ab = {x = 32735, y = 31668, z = 6}
local venore = {x = 32952, y = 32024, z = 6}
local ah = {x = 33089, y = 32884, z = 6}

if buttonId == 2 then
return false
else
    if choiceId == 1 then
player:teleportTo(thais)
return true
    end
    if choiceId == 2 then
player:teleportTo(carlin)
return true
    end
    if choiceId == 3 then
player:teleportTo(venore)
return true
    end
    if choiceId == 4 then
player:teleportTo(ab)
return true
    end
    if choiceId == 5 then
player:teleportTo(ah)
return true
    end
    if choiceId == 6 then
player:teleportTo(edron)
return true
    end
   
    end
end
end

Code:
player:registerEvent("Destination")

talkactions:
Code:
<talkaction words="/home" script="my scripts/homeme.lua" />


Code:
function onSay(cid, words, param)

local player = Player(cid)
   
  local Destination = ModalWindow(2, "Destination", "Make your choice:")
Destination:addChoice(1, "1. Thais")
Destination:addChoice(2, "2. Carlin")
Destination:addChoice(3, "3. Venore")
Destination:addChoice(4, "4. Ab'dendriel")
Destination:addChoice(5, "5. Ankrahmun")
Destination:addChoice(6, "6. Edron")
  Destination:addButton(1, 'Go')
  Destination:addButton(2, 'Exit')
  Destination:sendToPlayer(player)
   

  return false
   
end
 
Yes, but 0.3.6 Can't use it, 1.0,0.3.7,0.4 already has the function(atleast mine does)

I don't think this script will work on 0.3.7. The meta tables he uses is added in TFS 1.0, isn't it?
Also, as far I know , modal was added in TFS 1.0 ..
 
I don't think this script will work on 0.3.7. The meta tables he uses is added in TFS 1.0, isn't it?
Also, as far I know , modal was added in TFS 1.0 ..
Well I tested it on mine, worked for me tho :p
 
With this modal window you can create unlimitted new things. Eg: Now i'm creating mining, blacksmithing
That's called learning!

@OP

Thanks for the release! Also your image is not displaying anymore.
 
Now I could do way better :) When I'm looking at this code it's looks so messy right now :D Soon I'm going to make it more clear
 
Back
Top