AylinCE Grandmaster Cheater Supreme Reputation: 32
Joined: 16 Feb 2017 Posts: 1253
|
Posted: Wed Jun 29, 2022 11:24 am Post subject: |
|
|
Try this code in a separate tab.
( Lua Script: CheatTable >> File >> + New Tab )
Copy the code, paste it in the new tab and run.
Take what works for you from the code and change the names of the objects according to your own form.
Code: | if form then form.Destroy() form=nil end
form = createForm()
form.Width = 300
form.Height = 100
form.BorderStyle = bsSingle
form.Position = poScreenCenter
form.PopupMode = 0
form.Caption = name or 'Select Item'
combobox1 = createComboBox(form)
combobox1.Width = form.Width - 20
combobox1.Left = 10
combobox1.Top = 15
edit1 = createEdit(form)
edit1.Width = 80
edit1.Left = 45
edit1.Top = 60
button1 = createButton(form)
button1.Width = 100
button1.Left = 150
button1.Top = 60
button1.Caption = 'Print'
local setTbl = {"Human","Barbarian","Half-elf","Elf","Dark Elf"}
combobox1.items.add("Select Item")
combobox1.itemIndex=0
-- set
for i,k in pairs(setTbl) do
combobox1.items.add(k)
end
-- Get items
edit1.OnChange=function()
local b=tonumber(edit1.Text)
if b~=nil then
if b>#setTbl then
showMessage("Max limit: " .. #setTbl)
else
combobox1.itemIndex=edit1.Text
end
else
edit1.Text=""
end
if edit1.Text=="" then combobox1.itemIndex=0 end
end
button1.OnClick=function()
print(combobox1.Text)
end |
_________________
|
|