Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I tried to make a script the texture of a decal and it did not work. Any help?

Asked by 6 years ago

I tried to make a script that changes the value of a decal texture but when i run the game nothing happens. Can somone help me with this?

ProjectDecal = game.Workspace.DecalBrick.Decal.Texture
ProjectDecal = 3620710

2 answers

Log in to vote
0
Answered by 6 years ago
ProjectDecal = game.Workspace.DecalBrick.Decal.Texture
ProjectDecal = "3620710"
Ad
Log in to vote
0
Answered by 6 years ago

ProjectDecal is not a reference, it's a value. So you need to create a reference to change something that quick.

Reference is the variable which keeps full name of an object(Like game.Workspace.etc) to reach it, but if you equal a variable to a property of an object, it does not count as a reference, just takes its value to use later on.

Also you need to use rbxassetid://

For short, here's the code you need to use

ProjectDecal = game.Workspace.DecalBrick.Decal
ProjectDecal.Texture = "rbxassetid://3620710"
0
*Appluase* thesit123 509 — 6y
0
i was gonna say that :c, well you were fast moncefci3 -3 — 6y

Answer this question