✓ Accepted answer
As supersmartnoobguy has stated, said light will only be created upon the Cannon part being touched.
I'd like to merely point out a few things. Firstly, you should make it a habit to use local variables, primarily being because they're easier to access (the Lua wiki states that local variables access an array of registers on the stack, as opposed to 'regular' variables indexing a table (if you were interested)). You can read more about the differences here.
You define a local variable by preceding the variable name with the local keyword, as such:
local variable = 'this is a variable'
You're also trying to access a non-existent property of the SurfaceLight. If you look under the properties header, you'll find there's no such property named Position.
On top of this, the Color3.new() constructor uses r, g and b arguments between 0 and 1 - in your case, you'd use the Color3.fromRGB()constructor. However:
Color3.new(255, 0, 0) is the same as Color3.new(1, 0, 0).
You're also assigning a new variable FL to the SurfaceLight being created - you could just remove the 7th line, and replace the 6th line with:
local FL = Instance.new('SurfaceLight')
If you have any issues, let me know!
3 comments
Function of it is that the light will be inserted if a part 'Cannon' is being touched
pls use Color3 instead of BrickColor, e.g, Light.Color3 = Color3.fromRGB(255,0,0) will make a red color
The BrickColor is a coloring for a part