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

Changing Decals on a Brick?

I want to switch between two images infinitely on a brick. When I click 'Play Here' and check the decal ID the images are switching like they're supposed to, but it is not showing up in the game. Any help? Thanks in advance!

local decal = script.Parent

local image1 = "http://www.roblox.com/asset/?id=1218322396"
local image2 = "http://www.roblox.com/asset/?id=1218323284"
local images = {image1, image2}
while true do
for i,v in pairs(images) do
	decal.Texture = v
	wait(3) 
end
end

1 answer

✓ Accepted answer

Local scripts don't work in Workspace ingame. You have to create a local script in StarterPlayer>StarterPlayerScripts. So, your script should look like this:

local decal = game:GetService("Workspace").TV.Screen.Decal
local image1 = "http://www.roblox.com/asset/?id=1218322396"
local image2 = "http://www.roblox.com/asset/?id=1218323284"
local images = {image1, image2}
while true do
	for i,v in pairs(images) do
		decal.Texture = v
		wait(3)
	end
end

Above should be your script. Hope this helps! Good luck.

19 comments

0

Thank you for responding! I tried this and inserted it into the StarterPlayerScripts and it is not working in game or in the Decal ID properties. Is there another way to get this to work?

0

Are you using a texture or decal?

0

I tested this myself ingame and it worked fine. You must have typed something in wrong.

0

Here's what I have:

0

local decal = game:GetService("Workspace").TV.Screen.ArtmisaWelcome

0

Is ArtmisaWelcome the name of your decal or part?

0

It is the name of my decal

0

Are you getting any errors in the client or server or server consoles? (While ingame press F9 to access the console)

0

Yes, in the Client Log it says "ArtmisaWelcome is not a valid memebr of Part"

0

Oh my gosh, I'm so sorry the name of my decal is "Decal" I fixed this in the script, but the Decal is still not changing in game and there aren't any errors in the console. Again, I am so sorry for that mistake

0

I've just updated the above script. Does your script match it exactly?

0

Yes, it matches. It's not working in the PlayerScripts. When I place the script in the decal it doesn't work in game but it switches between the two decals in Properties

0

You also should make sure your images work. Open the Properties tab if you haven't already and select the Decal. Insert your image ID's into the Textures blank. If the image loads, it's a good image. If it doesn't get a different image then try again.

0

hmm

0

Is the Transparency tab of your Decal set to 0?

0

Yes it's set to 0 and both of the images load. Is there anything else I might not have done correctly? I really appreciate you taking the time to help!

0

For last resort, I'd create a new part and decal inside. When I tested them, I just used the default settings for both, besides size and it worked. See if that works. You might have something configured on the part that is breaking it.

0

AHH It's Working! I placed both decals in the part and scripted the transparencies with a 5 second wait in between. Thank you so much for helping me!

0

Your welcome!

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