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 4 years ago
Edited 4 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

repeat
beam.Transparency = beam.transparency + 0.05
until 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:

local beam = game.Workspace.lights.Part.Beam
repeat
    beam.Transparency = (0.55)
    wait(0.05)
    beam.Transparency = (0.6)
    wait(0.05)
    beam.Transparency = (0.65)
    wait(0.05)
    beam.Transparency = (0.7)
    wait(0.05)
    beam.Transparency = (0.75)
    wait(0.05)
    beam.Transparency = (0.8)
    wait(0.05)
    beam.Transparency = (0.85)
    wait(0.05)
    beam.Transparency = (0.9)
    wait(0.05)
    beam.Transparency = (0.95)
    wait(0.05)
    beam.Transparency = (1)
    wait(2)
    beam.Transparency = (0.95)
    wait(0.05)
    beam.Transparency = (0.9)
    wait(0.05)
    beam.Transparency = (0.85)
    wait(0.05)
    beam.Transparency = (0.8)
    wait(0.05)
    beam.Transparency = (0.75)
    wait(0.05)
    beam.Transparency = (0.7)
    wait(0.05)
    beam.Transparency = (0.65)
    wait(0.05)
    beam.Transparency = (0.6)
    wait(0.05)
    beam.Transparency = (0.55)
    wait(0.05)
    beam.Transparency = (0.5)
    wait(2)
    until false
0
Make it a server script and remove the () Trading_Opportunity 191 — 4y
0
Make it a server script and remove the () Trading_Opportunity 191 — 4y
0
tried both RazerGaming2312 3 — 4y
0
it cannot be capitalized, the word "transparency" always has to be lower case. Sulu710 142 — 4y
0
no it doesnt RazerGaming2312 3 — 4y

1 answer

Log in to vote
1
Answered by
St_vnC 330 Moderation Voter
4 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 :

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

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