Title explains it all. How would I go about adding a decal to a part created by a script? I have an Instance.new to make the part. All I need is a way to put the decal on the part, and more specifically, the front face.
local decal = Instance.New(“Decal”)
decal.Parent = [Your Part]
decal.Texture = [Image ID]
Would I put this underneath the area where I specify the parts properties?
You just need to put @AlbertSeir’s code below where you’ve instantiated the part, and don’t forget to replace the part and image id that he specified.
simply put
Decal.Face = Enum.NormalId.Front
this script changes the face of the decal on where you want the decal to be.
Alright, thanks to everyone that helped.
Edit: I found a quick issue. I’m using this script to make bullet holes, but it doesn’t seem to work. I’m looking at the bullet holes being generated in the workspace, and they don’t have decals on them.
bullet.Name = "Bullet"
bullet.BrickColor = BrickColor.new("Bright yellow")
bullet.Anchored = true
bullet.CanCollide = false
bullet.Position = pos
bullet.Size = Vector3.new(0.1,0.1,0.1)
bullet.Parent = workspace:WaitForChild("Ignore")
bullet.Transparency = 1
game.Debris:AddItem(bullet, 5) --time (in seconds) it takes for the bullet to despawn
local decal = Instance.new("Decal")
decal.Parent = workspace.Ignore.Bullet
decal.Texture = (130624105)
decal.Face = Enum.NormalId.Top
end
end)
You need to convert it to an rbxassetid, like this:
local decal = Instance.new("Decal")
decal.Parent = workspace.Ignore.Bullet
decal.Texture = rbxassetid://130624105
decal.Face = Enum.NormalId.Top
Thanks! I’ll give it a try in a bit
Hmm, seems like it is saying that it was expecting (, {, or string, but it got /. Any ideas why?
Try removing one of the /'s.
charr
Same problem, still saying it was expecting something else.
Edit: Fixed it, just had to put it in quotes