Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

5 comments

0

Make it a server script and remove the ()

0

Make it a server script and remove the ()

0

tried both

0

it cannot be capitalized, the word "transparency" always has to be lower case.

0

no it doesnt

1 answer

✓ Accepted answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.