View previous topic :: View next topic |
Author |
Message |
lothe23 Advanced Cheater Reputation: 0
Joined: 28 May 2016 Posts: 51
|
Posted: Sun Jul 03, 2016 8:28 pm Post subject: button that increases value |
|
|
how do i create a button that increases a integer value?
|
|
Back to top |
|
|
ParkourPenguin I post too much Reputation: 140
Joined: 06 Jul 2014 Posts: 4293
|
Posted: Sun Jul 03, 2016 8:33 pm Post subject: |
|
|
Code: | f = createForm()
local b = createButton(f)
b.OnClick = function(sender)
writeInteger(address, readInteger(address)+10)
end |
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
|
lothe23 Advanced Cheater Reputation: 0
Joined: 28 May 2016 Posts: 51
|
Posted: Sun Jul 03, 2016 8:43 pm Post subject: |
|
|
ParkourPenguin wrote: | Code: | f = createForm()
local b = createButton(f)
b.OnClick = function(sender)
writeInteger(address, readInteger(address)+10)
end |
|
im sorry i didnt explain properly, i already got a button and when it is pressed i want it to increase the value with 10
|
|
Back to top |
|
|
ParkourPenguin I post too much Reputation: 140
Joined: 06 Jul 2014 Posts: 4293
|
Posted: Sun Jul 03, 2016 8:46 pm Post subject: |
|
|
If you're using the form designer, click on the button, go to the "Events" tab in the object inspector, and assign a function to the OnClick event manually (double click it and CE will make one for you).
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
|
lothe23 Advanced Cheater Reputation: 0
Joined: 28 May 2016 Posts: 51
|
Posted: Sun Jul 03, 2016 8:49 pm Post subject: |
|
|
ParkourPenguin wrote: | If you're using the form designer, click on the button, go to the "Events" tab in the object inspector, and assign a function to the OnClick event manually (double click it and CE will make one for you). |
yeah but how do i assign a function that increases a value with etc 10?
like within this?
Code: | function CEButton1Click(sender)
end |
this might be so stupid but i couldnt find a thread bout it somewhere else
|
|
Back to top |
|
|
ParkourPenguin I post too much Reputation: 140
Joined: 06 Jul 2014 Posts: 4293
|
Posted: Sun Jul 03, 2016 8:51 pm Post subject: |
|
|
ParkourPenguin wrote: | writeInteger(address, readInteger(address)+10) |
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
|
lothe23 Advanced Cheater Reputation: 0
Joined: 28 May 2016 Posts: 51
|
Posted: Sun Jul 03, 2016 9:24 pm Post subject: |
|
|
ParkourPenguin wrote: | ParkourPenguin wrote: | writeInteger(address, readInteger(address)+10) |
| '
thx!
|
|
Back to top |
|
|
|