View previous topic :: View next topic |
Author |
Message |
Frouk Grandmaster Cheater
Reputation: 5
Joined: 22 Jun 2021 Posts: 510
|
Posted: Sat Oct 09, 2021 9:05 am Post subject: [Lua Form]Disable all checkboxes [solved] |
|
|
I want to disable all checkboxes and execute function while disabling
I tried this: Code: | for i,v in pairs(checkbox) do
checkbox[i].Checked = false
end |
Which is failing
Last edited by Frouk on Sat Oct 09, 2021 12:00 pm; edited 1 time in total |
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25777 Location: The netherlands
|
Posted: Sat Oct 09, 2021 10:59 am Post subject: |
|
|
try v.Checked=false
and make sure the script can deactivate.
and set the code in the OnChange event, not OnClick
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
Frouk Grandmaster Cheater
Reputation: 5
Joined: 22 Jun 2021 Posts: 510
|
Posted: Sat Oct 09, 2021 11:49 am Post subject: |
|
|
^
I've tried,but didn't helped(btw checkboxes are OnChange event)
EDIT:
I've puted script in disable section (means that while closing form, on close function jumps into disable section, but ignoring checkboxes)
|
|
Back to top |
|
 |
ByTransient Expert Cheater
Reputation: 5
Joined: 05 Sep 2020 Posts: 240
|
Posted: Sat Oct 09, 2021 1:58 pm Post subject: |
|
|
Code: | if f then f.Destroy() end
f=createForm()
btn1=createButton(f) btn1.width=120
btn1.left=120 btn1.top=40 btn1.caption="ReCheck"
btn2=createButton(f) btn2.width=120
btn2.left=120 btn2.top=80 btn2.caption="CheckFalse"
btn3=createButton(f) btn3.width=120
btn3.left=120 btn3.top=120 btn3.caption="FullCheckFalse"
local fLocale = {}
local cnt=0
for x = 0, 6 do
a=1 + tonumber(x)
fLocale['checkbox'..a]=createCheckBox(f)
fLocale['checkbox'..a].name='checkbox'..a
--fLocale['checkbox'..a].caption=fLocale['checkbox'..a].name
cnt=a
end
fLocale.checkbox1.caption="Hack 1"
fLocale.checkbox2.caption="Hack 2"
fLocale.checkbox1.top=10
fLocale.checkbox2.top=30
fLocale.checkbox3.top=50
fLocale.checkbox4.top=70
fLocale.checkbox5.top=90
fLocale.checkbox6.top=130
fLocale.checkbox7.top=150
btn1.OnClick=function()
for x = 1, tonumber(cnt) do
res=fLocale['checkbox'..x]
if res.Checked == false then
res.Checked = true
else
res.Checked = false
end
end
end
btn2.OnClick=function()
for x = 1, tonumber(cnt) do
res=fLocale['checkbox'..x]
res.Checked = false
end
end
local chck=1
btn3.OnClick=function()
local function test()
for x = 1, tonumber(cnt) do
res=fLocale['checkbox'..x]
if chck==2 then
res.Checked = true
btn3.caption="FullCheckFalse"
else
res.Checked = false
btn3.caption="FullChecktrue"
end
end
end
if chck==1 then
chck=2 test()
else
chck=1 test()
end
end |
|
|
Back to top |
|
 |
|