Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Entered a Valid Number for Transparency (1), got told Number Sequence?

Asked by 4 years ago

Error Code: 04:13:18.041 - Players.Avinychus_RD.PlayerGui.Loading.low.LocalScript:10: bad argument #3 to 'Transparency' (NumberSequence expected, got number)

Code:

script.Parent.MouseButton1Click:connect(function()
    script.Parent.Parent.lowselected.Visible = false
    script.Parent.Parent.highselected.Visible = true
    game.Lighting.SunRays.Enabled = true
    game.Lighting.Blur.Enabled = true
    game.Lighting.Bloom.Enabled = true
    game.Lighting.ColorCorrection.Enabled = true
    workspace.Grass.Patch1.Transparency = 0
    workspace.Grass.Start1.Transparency = 0
    workspace.Grass.Patch1.ParticleEmitter.Transparency = 0
    workspace.Grass.Start1.ParticleEmitter.Transparency = 0
end)

1 answer

Log in to vote
0
Answered by
Elixcore 1337 Moderation Voter
4 years ago

ParticleEmitter's transparency takes a NumberSequence, not a number. They range from 0 to 1.

An example of this would be:

particle.Transparency = NumberSequence.new(0,1)

that will make the transparency start at 0 and end at 1.

If you want to set the transparency to 0 do

NumberSequence.new(0,0)
0
I thought NumberSequence.new took an array of NumberSequenceKeypoints? Or is that the case only for when someone wants to specify the time for a value as well? Ankur_007 290 — 4y
0
Only when you want to specify the time as well, for his case this will work well enough. Elixcore 1337 — 4y
Ad

Answer this question