Posted: Sun Mar 27, 2022 1:14 pm Post subject: Re: How to change this scripts "direction"
You will never learn how to code by asking something this simple without first trying to understand it at all. I strongly encourage you to experiment and google if you want to get better.
There are literally THREE lines of logic in this code.
One, two, three.
Changing one thing at a time produces drastically different results and teaches you how it works by observation.
Ask yourself:
What does e.Left represent?
Why did the original programmer need a Main.Width and e.Width?
What is accomplished through the compare and set of e.Left?
How can I accomplish the inverse of these?
Experiment:
What happens if I change a 1 to a 2 or 5?
What happens if I change a (+) to a (-)?
I have never done anything with CEPanels before, so no guarantees:
Code:
local e = Main.CEPanel1
e.Left = e.Left - 1
if e.Left < 0 - e.Width then
e.Left = (Main.Width + e.Width)
end
Posted: Sun Mar 27, 2022 6:20 pm Post subject: Re: How to change this scripts "direction"
cooleko wrote:
You will never learn how to code by asking something this simple without first trying to understand it at all. I strongly encourage you to experiment and google if you want to get better.
There are literally THREE lines of logic in this code.
One, two, three.
Changing one thing at a time produces drastically different results and teaches you how it works by observation.
Ask yourself:
What does e.Left represent?
Why did the original programmer need a Main.Width and e.Width?
What is accomplished through the compare and set of e.Left?
How can I accomplish the inverse of these?
Experiment:
What happens if I change a 1 to a 2 or 5?
What happens if I change a (+) to a (-)?
I have never done anything with CEPanels before, so no guarantees:
Code:
local e = Main.CEPanel1
e.Left = e.Left - 1
if e.Left < 0 - e.Width then
e.Left = (Main.Width + e.Width)
end
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum