Luhkaaa
(REAL1TY)
May 2, 2022, 11:57am
#1
I’m using for loops for this.
I’m currently trying to make a more efficient way of fading transparency without TweenService.
Unfortunately I stumbed across this error:
This is the problematic line:
This error only pops up when I add
- behind
=
Here’s the for loop part of the script that is not functioning, everything else is fine.
Any way I can fix this…?
FerbZides
(FerbZides)
May 2, 2022, 12:07pm
#2
5uphi
(5uphi)
May 2, 2022, 12:31pm
#3
for i = 1, 0, -0.25 do
Lens.Transparency = i
light.Transparency = NumberSequence.new(i, 1)
spotLight.Brightness += 2.5
task.wait()
end
or
local currentValue = light.Transparency.Keypoints[1].Value
light.Transparency = NumberSequence.new(currentValue - 0.25, 1)
also make sure to benchmark because tweenservice is already efficient so you might not be saving any performance by doing this
Luhkaaa
(REAL1TY)
May 4, 2022, 1:51pm
#4
Running TweenService on server is not a good thing to do as far as I know…
Let me try the code first although.
5uphi
(5uphi)
May 4, 2022, 2:00pm
#5
Running the tween service on the server side
Or
Setting a instance property many times on the server side
Have the same negative effect of having to send the instant properties over the network to all the clients multiple times
Running TweenService on the server is all fine.
That is not to say, that you should overdo them.
Hi!
I would suggest that you keep doing tweens. But if you insist on sticking to your work-around method, then I would suggest this for the beam:
Fixture.Head.Beam.Light.Transparency = NumberSecuence.new((.25*5)-(.25*i),1) -- I tried to adapt the method to your for-loop, which right now loops through 5 times.