For example an explosion on a certain terrain. If I shoot a projectile and it hits a green brick the explosion pieces will be green. I'm trying to get the explosion pieces to be the same color of the brick they touched. Here's what I got:
if hit.Anchored == true and hit.CanCollide == true then
for i=1,5 do -- # of explosion pecies
local eff = game.ServerStorage.effect:Clone() --Creating
eff.Size = Vector3.new(1,1,1) --Sizing the effect
eff.BrickColor = BrickColor.new(hit.BrickColor) --*
game.Debris:AddItem(eff,1) --Destroying the effect
end
end
I deleted the junk I don't need help with like bodyvelocity and stuff.

4 comments
What is "hit"? Is this a snippet of the entire code? Did you check the Output? Did it return an error from the script? If so, could you please provide it? ;-;
Change "eff.BrickColor = BrickColor.new(hit.BrickColor)" to "eff.BrickColor = hit.BrickColor". The property BrickColor returns a BrickColor, which isn't a valid parameter in BrickColor.new(). Thus, you can simply use hit.BrickColor.
Wow it was that simple, gg. Thanks for your help Uglypoe. If you make it into an answer I'll mark it as solved.
Yeah make it an answer.. answering in comments is annoying