Beam does not change using script

I’m making a script where when a player spawns, a beam is created. However, when I try to play the game, the default beam comes up instead of the beam I wanted:

Proof of issue. (1.8 MB)

Here is the script:

-- Create the instance.

local beam = Instance.new("Beam",game.Players.LocalPlayer.Character)

-- Give the beam the correct properties.

if game.Players.LocalPlayer.Character:WaitForChild("HumanoidRootPart") then

beam.Attachment0 = game.Players.LocalPlayer.Character.HumanoidRootPart.RootRigAttachment

beam.Attachment1 = game.Workspace.TestPart.BeamFlow

beam.Color = Color3.fromRGB(255, 0, 0)

beam.Texture = "rbxassetid://878102417"

beam.TextureSpeed = 5

beam.TextureMode = "Static"

beam.FaceCamera = true

end

-- The script ends. 

Instead of using

beam.Color = Color3.fromRGB(255, 0, 0)

Try using

beam.Color = ColorSequence.new(Color3.fromRGB(255, 0, 0))

This is because beams don’t use Color3 they use ColorSequence hope this helps!