This is the script, it’s trying to randomise the decal’s texture:
while true do
script.Parent.Decal1.Texture = "http://www.roblox.com/asset/?id=6881965865"
script.Parent.Decal2.Texture = "http://www.roblox.com/asset/?id=6881965865"
wait(30)
script.Parent.Decal1.Texture = "http://www.roblox.com/asset/?id=6897736901"
script.Parent.Decal2.Texture = "http://www.roblox.com/asset/?id=6897736901"
wait(30)
script.Parent.Decal1.Texture = "http://www.roblox.com/asset/?id=6881965865"
script.Parent.Decal2.Texture = "http://www.roblox.com/asset/?id=6881965865"
wait(30)
script.Parent.Decal1.Texture = "http://www.roblox.com/asset/?id=6897736901"
script.Parent.Decal2.Texture = "http://www.roblox.com/asset/?id=6897736901"
wait(30)
end
It gives no output but the model looks like this:
4 Likes
Wouldn’t it be easier to just put all of the texture ID’s into a table and then randomly pick them out of that?
Also can you show a screenshot of what the Explorer tab looks like.
4 Likes
What @ComplicatedParadigm said, wouldn’t it be easier to just put the ID’s into a table?
2 Likes
Erie20
(dont play_games)
June 3, 2021, 8:02pm
#4
Try adding s to the http? I remember the same problem occured to another person, but with animations.
1 Like
I don’t think it’d make any difference, as long as it’s a ROBLOX Url then it should be fine:
Perhaps try this:
local Thing = script.Parent
local Decals = {
"http://www.roblox.com/asset/?id=6881965865";
"http://www.roblox.com/asset/?id=6897736901";
}
while true do
Thing.Decal1.Texture = Decals[1]
Thing.Decal2.Texture = Decals[1]
print("Changing to 1")
wait(30)
Thing.Decal1.Texture = Decals[2]
Thing.Decal2.Texture = Decals[2]
print("Changing to 2")
wait(30)
end
Wouldn’t hurt to print
2 Likes
JayO_X
(fakefriends)
June 3, 2021, 8:08pm
#6
Make sure the link actually redirects you to the asset not a 404 page
1 Like
Add a wait after the second texture line. I think that will go through the second one too quickly and just go back to the first one.
1 Like
JayO_X
(fakefriends)
June 3, 2021, 8:10pm
#8
Are you trying to get an image from the library?
Are you sure that the problem isn’t that the texture are badly positioned on the object? Also try use “rbxassetid://ID” instead of the http link.
According with @ComplicatedParadigm you could use this script:
local id = {1234, 12345}
while true do
script.Parent.Texture = "rbxassetid://"..id[math.random(1, #id)]
wait(30)
end
1 Like
Change the wait time smaller, then see if it works. If not working then your link might not be right.
local decals = {
6881965865,
6897736901
}
while (wait(30)) do
local decal = "rbxassetid://" .. decals[math.random(1, #decals)]
script.Parent.Decal1.Texture = decal
script.Parent.Decal2.Texture = decal
end
That should work but I don’t think the string is necessary since it works with the ID too.
You need the string because by a script it doesn’t set the string automatically as it does when is set by a user.
No, I am pretty sure it does not work with the ID by itself.
JayO_X
(fakefriends)
June 4, 2021, 12:00am
#15
you don’t need the brackets for the wait function
while wait(30) do block end
1 Like
It’s a personal preference
1 Like
It works and changes the property like this:
But in the game it appears like this:
Are the Decals fully loading in? There could be the possible chance that it hasn’t loaded or not, and do check the Output for errors?
There are no errors, as it seems the decal’s texture property is being filled but it doesn’t enter.
SOTR654
(SOTR654)
June 4, 2021, 9:49pm
#20
Try this:
function format(Id)
return string.format("rbxthumb://type=Asset&id=%s&w=420&h=420", Id)
end
while wait(30) do
script.Parent.Decal1.Texture = format(6881965865)
script.Parent.Decal2.Texture = format(6881965865)
wait(30)
script.Parent.Decal1.Texture = format(6897736901)
script.Parent.Decal2.Texture = format(6897736901)
wait(30)
script.Parent.Decal1.Texture = format(6881965865)
script.Parent.Decal2.Texture = format(6881965865)
wait(30)
script.Parent.Decal1.Texture = format(6897736901)
script.Parent.Decal2.Texture = format(6897736901)
end
Something wrong?
Original post:
This is probably because you need the asset image id, not decal id. If you want to get the image id easily, you can use rbxthumb://
string.format("rbxthumb://type=Asset&id=%s&w=420&h=420", Id)
You can also paste the decal id into an image in studio and it will automatically format it to the correct image id for you.
1 Like