This is supposed to change the colour of a part depending on the mode, but doesn't.
local Colors = {BrickColor.new("Brown"), BrickColor.new("Dusty Rose"), BrickColor.new("Dark stone grey"), BrickColor.new("Med stone grey")}
local mode = script.Parent.Mode
function MakeSpark(pos)
local effect = Instance.new("Part")
effect.Name = "Effect"
effect.Anchored = false
effect.CanCollide = false
effect.Shape = "Block"
effect.formFactor = "Custom"
effect.Material = Enum.Material.Plastic
effect.Locked = true
effect.TopSurface = 0
effect.BottomSurface = 0
effect.BrickColor = Colors[1]
-- From here
if mode.Value == 1 or 2 then
effect.BrickColor = Colors[1]
elseif mode.Value == 3 then
effect.BrickColor = Colors[2]
elseif mode.Value == 4 then
effect.BrickColor = Colors[3]
end
-- To here, doesn't work
effect.CFrame = CFrame.new(pos)
effect.Parent = game.Workspace
end
Thanks.

1 comment
Thanks, come to think of it, that is exactly what my computer science teacher said when I made the same mistake on Python...