• 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!

How to use TextEdit

eduardbean

Member
Joined
Nov 26, 2010
Messages
129
Solutions
2
Reaction score
15
This script get player text in 'TextEdit' and see if is = Demon, but dont work, player text return "", how i can make a Text Editor in .otui for player make text and search for Demon.

.lua
Code:
function init()

  MonstersButton = modules.client_topmenu.addRightGameToggleButton('MonstersButton', tr('Monsters'), '/images/topbuttons/Monsters', toggle)
  MonstersButton:setOn(false)
  
  MonstersWindow = g_ui.displayUI('Monsters.otui')
  MonstersWindow:setVisible(false)

  ShowDemon = g_ui.displayUI('Monsters/Demon')
  ShowDemon:setVisible(false)
  
  MonsterName = MonstersWindow:getChildById('getMonsterName'):getText()

end

function searchMonster()
  if MonsterName == 'Demon' then
    ShowDemon:show()
  end
  print(MonsterName)
end

.otui
Code:
  TextEdit
    id: getMonsterName
    anchors.top: GetMonster1.bottom
    anchors.left: parent.left
    anchors.right: searchButton.left
    margin-top: 5
    margin-right: 5

  Button
    id: searchButton
    !text: tr('Search')
    width: 50
    anchors.top: GetMonster1.bottom
    anchors.right: parent.right
    margin-top: 5
    @onClick: searchMonster()
 
Last edited:
TextEdit
id: getText1
anchors.top: parent.top
anchors.left: parent.left
margin-top: 5
margin-right: 5
text: "test text"

or just
text: ''
 
But TextEdit is for player set text like a password, account, server etc

- - - Updated - - -

Bump Please e really need help
 
Back
Top