do you play roblox?
Offline
his scratch username :3
Offline
It should work.whenclicked
foreverwait untilkeyleft ▼pressed?setX Velocity ▼to-7repeat untilnotkeyleft arrow ▼pressed?change x byX Velocityrepeat untilX Velocity>-0.1setX Velocity ▼toX Velocity*0.98change x byX VelocitysetX Velocity ▼to0
Last edited by jontmy00 (2012-08-15 08:53:27)
Offline
jontmy00 wrote:
It should work.whenclicked
foreverwait untilkeyleft ▼pressed?setX Velocity ▼to-7repeat untilnotkeyleft arrow ▼pressed?change x byX Velocityrepeat untilX Velocity>-0.1setX Velocity ▼toX Velocity*0.98change x byX VelocitysetX Velocity ▼to0![]()
Or:
whenclicked
foreverifkeyleft arrow ▼pressed?change x by-1
Last edited by JH1010 (2012-08-15 14:01:10)
Offline
JH1010 wrote:
jontmy00 wrote:
It should work.whenclicked
foreverwait untilkeyleft ▼pressed?setX Velocity ▼to-7repeat untilnotkeyleft arrow ▼pressed?change x byX Velocityrepeat untilX Velocity>-0.1setX Velocity ▼toX Velocity*0.98change x byX VelocitysetX Velocity ▼to0![]()
Or:
whenclicked
foreverifkeyleft arrow ▼pressed?change x by-1
Fixed.
Offline
Here's what I usually use:
whenclicked
foreverifkeyandleft arrow ▼pressed?<abs ▼ofx velocity10changex velocity ▼by-0.85ifkeyandright arrow ▼pressed?<abs ▼ofx velocity10changex velocity ▼by0.85setx velocity ▼tox velocity*0.89change x byx velocity
Last edited by henley (2012-08-16 14:34:09)
Offline
Why do people overcomplicate themselves with x/y velocities?
Offline
JH1010 wrote:
Why do people overcomplicate themselves with x/y velocities?
Well, they're smoother, and once you get used to them, they aren't too complicated...
But yes, the most basic moving left would be
ormovenegative numbersteps
change x bynegative number
Offline
JH1010 wrote:
Why do people overcomplicate themselves with x/y velocities?
It's not overcomplicated if you know how it works and what you're doing. It creates a much better, smoother sense of movement making it better than the choppy, immediate movement that you're limited to otherwise.
Offline
henley wrote:
Here's what I usually use:
whenclicked
foreverifkeyandleft arrow ▼pressed?<abs ▼ofx velocity10changex velocity ▼by-0.85ifkeyandright arrow ▼pressed?<abs ▼ofx velocity10changex velocity ▼by0.85setx velocity ▼tox velocity*0.89set x tox velocity
Instead of
did you meanset x tox velocity
Also, I believe it could be simplified tochange x byx velocity
{Sorry for any typos, can't edit posts.}whenclicked
setXVelocity ▼to0foreverif<abs ▼ofXVelocity10ifkeyleft arrow ▼pressed?changeXVelocity ▼by-1ifkeyright arrow ▼pressed?changeXVelocity ▼by1setXVelocity ▼toXVelocity*0.9change x byXVelocity
Offline
Oh, oops. I meant [change x by (x velocity)], I typo'd.
And you're right. I wonder why no one else has thought of that. You must be magic.
Offline
OverPowered wrote:
Also, I believe it could be simplified to
whenclicked
setXVelocity ▼to0foreverif<abs ▼ofXVelocity10ifkeyleft arrow ▼pressed?changeXVelocity ▼by-1ifkeyright arrow ▼pressed?changeXVelocity ▼by1setXVelocity ▼toXVelocity*0.9change x byXVelocity
Actually you dont need to use "abs" to limit the velocity. The "set velocity to" part of the script will limit the velocity itself.
whenclicked
setXVelocity ▼to0foreverifkeyleft arrow ▼pressed?changeXVelocity ▼by-1ifkeyright arrow ▼pressed?changeXVelocity ▼by1setXVelocity ▼toXVelocity*0.9change x byXVelocity
Offline
Wes64 wrote:
OverPowered wrote:
Also, I believe it could be simplified to
whenclicked
setXVelocity ▼to0foreverif<abs ▼ofXVelocity10ifkeyleft arrow ▼pressed?changeXVelocity ▼by-1ifkeyright arrow ▼pressed?changeXVelocity ▼by1setXVelocity ▼toXVelocity*0.9change x byXVelocityActually you dont need to use "abs" to limit the velocity. The "set velocity to" part of the script will limit the velocity itself.
whenclicked
setXVelocity ▼to0foreverifkeyleft arrow ▼pressed?changeXVelocity ▼by-1ifkeyright arrow ▼pressed?changeXVelocity ▼by1setXVelocity ▼toXVelocity*0.9change x byXVelocity
However, the "abs" portion of the script prevents the player from actively increasing their velocity over a value, much like
which is fine and well, except that the "abs" script is shorter and passively allows the player to be "flung" at faster than the maximum speed.ifsetXVelocity ▼to10ifsetXVelocity ▼to-10
Offline