– archived post, hiding scripts due to privacy reasons
If you calculate the value of x
and phase
down to 0 then sin(x -phase)
= 0.
x is a Value.
That’s why the line below while wait() do exists.
x = x + game.Workspace.TechnicaPannel:WaitForChild("MainPannel").P2.Faders.Sine.Intensity.Value.Value / 50
Basically I’m using a Value to change the speed, since velocity is for some reason ignored, which is not a problem to me, as long as the script works.
All I need to know is, if the script can be lowered down to a single line, if not, that’s fine.
But in that line does x ever = 0?
If you want to lower x to 0 then you’re going to have to figure out a changing variable that does that. Something like a percentage of the value that you can multiply by 100% down to 0%.
It’s only 0 at the start of the sine-wave, because user input is required to change the value manually.
Is it possible to make a table like this?
– archived picture
And then get the contents out of the table and create a Sine-Waveform, in one line?
Are you trying to decrease your script down to a singe line or the wave itself? I’m sorry if I misunderstood.
A sine wave goes up and down, crossing it’s amplitude center at the start, middle and end.
If you change the value of the amount it moves up and down you can control the height of both the + and - peaks.
So whatever value sets the height of the wave needs to be set to 0. If the player enters a height of 5 and you want to decrease it to 0 over time then multiply 5 by 100% and gradually decrease the value of the percentage down to 0%. The wave will still be formed with the same duration, but the peaks will decrease.
If you want to make the wave instantly go to 0 then the value of
x + game.Workspace.TechnicaPannel:WaitForChild("MainPannel").P2.Faders.Sine.Intensity.Value.Value / 50
has to = 0 .
It’s alright.
No, I mean’t the actual script down to a single line, sorry for making you confused the entire time along, should’ve mentioned it earlier, my bad.
If there’s anything else you want to add, you can.
If nothing else will be stated, I’ll delete (edit) the first post I made due to people I’ve known like to steal my code and claim as theirs.