How to put decal/texture ID in a script?

image
So I have this texture ID from a sword trail that I want to implement in a script.

image
And I have everything else from the trail inside the script but I don’t know how to include the texture with the ID in here. Any help would be appreciated.

local attachment1 = Instance.new("Attachment")

attachment1.Name = "attach_1"

attachment1.Position = Vector3.new(0.308,2.592,0)

local attachment2 = Instance.new("Attachment")

attachment2.Name = "attach_2"

attachment2.Position = Vector3.new(0.181,-1.028,0)

local trail = Instance.new("Trail")

trail.Name = "BladeTrail"

trail.TextureMode = Enum.TextureMode.Stretch

trail.TextureLength = 1

trail.Transparency = NumberSequence.new(0.5)

trail.Lifetime = 0.1

trail.MaxLength = 0

trail.MinLength = 0.1

trail.WidthScale = NumberSequence.new(1)

return {

["attachment1"] = attachment1;

["attachment2"] = attachment2;

["trail"] = trail

}

trail.Texture = “website name” .. 000000000 --replace the website name with the prefix of the url and the 0’s with your ID.

People often do this too:


local prefix = “website name”
trail.Texture = prefix .. 000000000 --replace the website name with the prefix of the url and the 0’s with your ID.

The … operator combines two strings. A string is group of alphabetical characters (a word, sentence, letter, etc). The operator also works with some other types, casting them into a string (in this case the ID, which is an Int/number).

Edit:
There are a few prefixes. Some of them do different things :man_shrugging: (I also don’t have them memorized :sweat_smile:)

You can’t use stuff from other websites, just do “rbxassetid://”

Thanks for the reply. I tried this and it doesn’t work for me. I must’ve done something wrong.

trail.Texture = "rbxassetid://6305308874"