|
| 11 Aug 2013 01:20 PM |
p = 0 while wait(.3) do p = script.Parent.Transparency if p == 1 then script.Parent.Transparency = p - .1 else script.Parent.Transparency = p + .1 end end
|
|
|
| Report Abuse |
|
|
|
| 11 Aug 2013 01:24 PM |
I have seen that there is a slight fluxuation in preciseness for Transparency. Try:
if math.abs(p-1) <= .05 then
instead of:
if p == 1 then |
|
|
| Report Abuse |
|
|
| |
|
|
| 11 Aug 2013 01:31 PM |
| try lowering .05 to maybe .02? |
|
|
| Report Abuse |
|
|
| |
|
|
| 11 Aug 2013 01:33 PM |
| Oh wait! I didn't notice that you defined the variable 'p' once! It doesn't automatically update with the transparency. It will remain the same. |
|
|
| Report Abuse |
|
|
|
| 11 Aug 2013 01:35 PM |
i defined it twice p = 0 while wait(.3) do p = script.Parent.Transparency
|
|
|
| Report Abuse |
|
|
|
| 11 Aug 2013 01:37 PM |
| Oh sorry. That was a rush on my part. If it is in the loop, it should be fine. |
|
|
| Report Abuse |
|
|
|
| 11 Aug 2013 01:39 PM |
| Yeah, it will keep oscillating between 0.9 and 1 because whenever it ISN'T 1 it will increase and whenever it IS 1 it will decrease. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 11 Aug 2013 01:50 PM |
| Do you want it to change from 0 to 1 and back to 0 repeatedly? |
|
|
| Report Abuse |
|
|
| |
|
|
| 11 Aug 2013 02:01 PM |
x = 1 while wait(.3) do x = x+.1 script.Parent.Transparency = math.abs(math.asin(math.cos(x*5/math.pi)))*2/math.pi end |
|
|
| Report Abuse |
|
|
|
| 11 Aug 2013 02:07 PM |
no not like that i want it to go though each .1 .1 .2 .3 .4 .5 .6 .7 .8 .9 |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 11 Aug 2013 02:26 PM |
Agh, there is some truncation error in that function. Just use this:
x = 1 while wait(.3) do if script.Parent.Transparency >= .98 then x = -1 elseif script.Parent.Transparency <= .02 then x = 1 end script.Parent.Transparency = script.Parent.Transparency+.1*x end |
|
|
| Report Abuse |
|
|
| |
|
|
| 11 Aug 2013 02:47 PM |
efficient way :
local x = script.Parent local a = 1
while wait(.3) do for i = 1, 10 do x.Transparency = x.Transparency + .1*a wait(.3) end a = -a end
|
|
|
| Report Abuse |
|
|
|
| 11 Aug 2013 02:49 PM |
bunnyboy x = 1 while wait(.3) do x = x+.1 script.Parent.Transparency = math.abs(math.asin(math.cos(x*5/math.pi)))*2/math.pi end
this makes no sense at all |
|
|
| Report Abuse |
|
|
|
| 11 Aug 2013 02:51 PM |
super super efficient way :
local x = script.Parent local a = 1
while wait(.3) do x.Transparency = x.Transparency + .1 * ((math.floor(x.Transparency + .5)*2)-1) end |
|
|
| Report Abuse |
|
|
|
| 11 Aug 2013 10:15 PM |
@FreeToTake
Before making assumptions, try Googling:
Graph for abs(asin(cos(x*5/pi)))*2/pi
And hopefully you'll see what I am getting at. |
|
|
| Report Abuse |
|
|
|
| 11 Aug 2013 10:17 PM |
| I don't see how that second script of yours is even supposed to work. |
|
|
| Report Abuse |
|
|
|
| 12 Aug 2013 11:06 AM |
| i just don't see of what use trigonometry functions are in this situation |
|
|
| Report Abuse |
|
|