Hello, I am currently working on a custom version of ACS 1.7 and I wish to make a material-based bullethole system, I already have the basics of it so, when you shoot, it creates a bullethole on whatever part the bullet hit. Now, what I need is for it to be material-based, so basically, different bulletholes depending on the material of the part that the bullet hit.
The lines for this system to work are:
local default_bulletholes = { "4117124202"; "4117124881"; "4117125609"; "4117126706"; "4117127411"; }
and
Evt.Hit:FireAllClients(Player, Position, HitPart, Normal, Material, Settings) local a = Instance.new("Part", BulletModel) a.FormFactor = "Custom" a.TopSurface = 0 a.BottomSurface = 0 a.Transparency = 1 a.CanCollide = false a.Size = Vector3.new(0.5, 0, 0.5) a.CFrame = CFrame.new(Position,Position-Normal) * CFrame.Angles(90*math.pi/180,math.random(0,360)*math.pi/180,0) a.BrickColor = BrickColor.new("Really black") a.Material = Enum.Material.Air local b = Instance.new('WeldConstraint') b.Parent = a b.Part0 = a b.Part1 = HitPart local c = Instance.new("Decal", a) c.Texture = "rbxassetid://"..default_bulletholes[math.random(1,5)] c.Face = "Top" -- c.Transparency = 0 local d = Instance.new("PointLight", a) d.Color = Color3.new(0, 0, 0) d.Range = 0 d.Shadows = true local e = Instance.new("Weld") e.Part0 = a e.Part1 = HitPart
Some help would be extremely appreciated.
My discord: krypto#0514
In the default_bulletholes table, name each index the specific Material you want it to be used on.
For example:
local default_bulletholes = {} default_bulletholes["Enum.Material.Plastic"] = whateverIdYouUseForPlastic
Then on line 19 of the second part, instead of math.random() do tostring(HitPart.Material).