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

Changing Decals on a Brick?

Asked by 7 years ago

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

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

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.

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? arkenzii 6 — 7y
0
Are you using a texture or decal? Crazycat4360 115 — 7y
0
I tested this myself ingame and it worked fine. You must have typed something in wrong. Crazycat4360 115 — 7y
0
Here's what I have: arkenzii 6 — 7y
View all comments (15 more)
0
local decal = game:GetService("Workspace").TV.Screen.ArtmisaWelcome arkenzii 6 — 7y
0
Is ArtmisaWelcome the name of your decal or part? Crazycat4360 115 — 7y
0
It is the name of my decal arkenzii 6 — 7y
0
Are you getting any errors in the client or server or server consoles? (While ingame press F9 to access the console) Crazycat4360 115 — 7y
0
Yes, in the Client Log it says "ArtmisaWelcome is not a valid memebr of Part" arkenzii 6 — 7y
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 arkenzii 6 — 7y
0
I've just updated the above script. Does your script match it exactly? Crazycat4360 115 — 7y
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 arkenzii 6 — 7y
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. Crazycat4360 115 — 7y
0
hmm Crazycat4360 115 — 7y
0
Is the Transparency tab of your Decal set to 0? Crazycat4360 115 — 7y
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! arkenzii 6 — 7y
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. Crazycat4360 115 — 7y
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! arkenzii 6 — 7y
0
Your welcome! Crazycat4360 115 — 7y
Ad

Answer this question