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

how do i change the transparency of a beam with a script?

Asked by 5 years ago
Edited 5 years ago

for some reason, it won't let me change the transparency of the beam with the script and i just can't put my finger on the reason edit: I've tried using

1repeat
2beam.Transparency = beam.transparency + 0.05
3until beam.Transparency == 1

and removing the "()"

error: "Players.TheRisingTides.PlayerGui.LocalScript:3: bad argument #3 to 21:51:46.122 'Transparency' (NumberSequence expected, got number)" script:

01local beam = game.Workspace.lights.Part.Beam
02repeat
03    beam.Transparency = (0.55)
04    wait(0.05)
05    beam.Transparency = (0.6)
06    wait(0.05)
07    beam.Transparency = (0.65)
08    wait(0.05)
09    beam.Transparency = (0.7)
10    wait(0.05)
11    beam.Transparency = (0.75)
12    wait(0.05)
13    beam.Transparency = (0.8)
14    wait(0.05)
15    beam.Transparency = (0.85)
View all 43 lines...
0
Make it a server script and remove the () Trading_Opportunity 191 — 5y
0
Make it a server script and remove the () Trading_Opportunity 191 — 5y
0
tried both RazerGaming2312 3 — 5y
0
it cannot be capitalized, the word "transparency" always has to be lower case. Sulu710 142 — 5y
0
no it doesnt RazerGaming2312 3 — 5y

1 answer

Log in to vote
1
Answered by
St_vnC 330 Moderation Voter
5 years ago

Its more complex than you think, Beam,Trail,Particle Emitters' Transparency are not used in regular numbers but in NumberSequence so you have to write :

1beam.Transparency = NumberSequence.new{
2    NumberSequenceKeypoint.new(1,1) --use these instead and adjust as you will
3}

Just a quick note, I don't use NumberSequence that much so if I make an error just do your research.

Ad

Answer this question