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

What am I doing wrong with changing the Beam's colour?

I am trying to change the effect Beam's colour in a script. But it's giving me an error and I don't know what is wrong or what is causing it to give me an error.

Here is the script:

local Zombie = workspace:WaitForChild("Zombie")
local ZombieHealth = Zombie:WaitForChild("Humanoid")
local UpperTorso = Zombie:WaitForChild("UpperTorso")
local DamageEffect = Instance.new("Beam")
local Attachment0 = Instance.new("Attachment")
local Attachment1 = Instance.new("Attachment")
	
Attachment0.Parent = workspace.Model.AI.Head
Attachment1.Parent = workspace.Zombie.Head
DamageEffect.Parent = workspace.Model.AI.Head
DamageEffect.Attachment0 = Attachment0
DamageEffect.Attachment1 = Attachment1
DamageEffect.LightEmission = 1
DamageEffect.Width0 = 1.5
DamageEffect.Color = Color3.new(0,0,255)      --What is wrong here?

Also, the error was bad argument #3 to 'Color' (ColorSequence expected, got Color3)

1 answer

✓ Accepted answer

The beam's colour property needs a ColourSequence

You can easily construct one with one colour by doing this:

beam.Color = ColorSequence.new(Color3.new(0,0,1))

You should also note that Colour3 values are numbers between 0 and 1.

1 comment

0

Thanks!

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