Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Is htere any way to do instance.new part with a decal on it?

Hello! This is a blood script I have and I was wondering if I could create the part with a decal on it?

s.Humanoid.Died:connect (function ()
wait (0)
P1 = Instance.new("Part",game.Workspace)
P1.Position = script.Parent.Torso.Position
P1.TopSurface = "Smooth"
P1.BottomSurface = "Smooth"
P1.BrickColor = BrickColor.new("Bright red")
P1.FormFactor = 2
P1.Size = Vector3.new(1,0.4,1)
P1.CanCollide = true
P1.Anchored = false

1 comment

0

Why does this question have -2 points?

3 answers

✓ Accepted answer

This is the full script you wanted.

s.Humanoid.Died:connect (function ()
wait() --changed to wait() insted of wait (0)
local P1 = Instance.new("Part", game.Workspace)
P1.Position = script.Parent.Torso.Position
P1.TopSurface = "Smooth"
P1.BottomSurface = "Smooth"
P1.BrickColor = BrickColor.new("Bright red")
P1.FormFactor = 2
P1.Size = Vector3.new(1,0.4,1)
P1.CanCollide = true
P1.Anchored = false

local decal = Instance.new("Decal")
decal.Parent = P1
decal.Texture = --texture id here
decal.Face = "Top"

2 comments

0

YAY! thank you! That worked!

0

Its alright. Accept this answer if it helpled >

Yes. Just do this:

local decal = Instance.new("Decal", P1)
decal.Texture = --texture id here

1 comment

0

Okay, I have tried but I can't figure out how to make this so it goes on the Top and Bottom Surface. Any help?

In response to your above comment, to get it on whichever face you want, you can just do something like this:

decal.Face = "Top"--(This can be any of the following: Top, Bottom, Front, Back, Left, or Right)

This will change the side of the part that the decal is on. Hope I helped :P

1 comment

0

This still did not work. The output says this:15:50:58.926 - decal is not a valid member of Part. And the decal goes on the front, And there is no texture. Any other soulutions?

This discussion is preserved as it was. New answers, comments, and votes are closed.