Please help me I'm new to scripting

Hello There,

I am having trouble scripting a loop could someone tell me what I’m doing wrong please.

  1. The I’m trying to make a billboard that changes image but it just stops and nothing happens

  2. **Here’s the Issue
    robloxapp-20220327-1333092.wmv (1.7 MB)
    **

  3. I’ve tried to do “script.Parent.part.Textrue = rbxassetid://9187905980” and nothing happens

while true do
script.Parent.Texture = "rbxassetid://9187905980"
wait(5)
script.Parent.Texture = "rbxassetid://9187891506"
wait(5)
end

Could someone tell me what I’m doing wrong thank you :slight_smile:

2 Likes

I am not best at coding especially not with this topic as I never change Textures but I’ll give it a try…

Have you tried using script.Parent.Texture = 9187905980

I have not tried that before I can see if it works.

It did nothing sorry should I try doing script.Parent.Part.Textrue = 9187905980

1 Like

Can you show me the part that you want to change the texture of so I can further assist?

1 Like

In the Video I did It showed both Images

I don’t think BillboardGuis have a texture property. You’re most likely trying to change something inside the BillboardGui. We will be able to assist you further under the assumption you provide a screenshot of what you’re trying to change in the explorer.

1 Like

Yes but I mean the properties of them in Roblox Studio

image_2022-03-27_135301
This is what I’m trying to change.

Oh, so it’s not a BillboardGui. You have to do script.Parent.Decal1.Texture as well as script.Parent.Decal2.Texture for this to work.

1 Like

Okay I Will try it out to See if that fixed it

Your doing script.Parent.Texure but that is making the script think that you want to change the texture of the block named “poster1” what you want to do is script.Parent.Decal1.Texture

I’m not the best at scripting, I’m still a beginner and learning, however I think your issue is with your texture changing line of code.

It may be a easier for you to create a variable and reference the part name.

For example, maybe something like this. Keep in mind I could be totally wrong too.

local decalChange = game.workspace.Poster1

while true do
decalChange.Decal1.Texture = "rbxassetid://9187905980"
wait(5)
decalChange.Decal2.Texture = "rbxassetid://9187891506"
wait(5)
end

It did nothing So Idk what to do :confused:

while true do
    script.Parent.Decal1.Texture = "rbxassetid://9187905980"
     script.Parent.Decal2.Texture= "rbxassetid://9187891506"
    wait(5)
    script.Parent.Decal1.Texture = "rbxassetid://9187891506"
    script.Parent.Decal2Texture = "rbxassetid://9187905980"
    wait(5)
end

Does this work?
(I’m not sure if you wanted to change both decals or just one)

1 Like

I just tested this out and it works fine for me

--http://www.roblox.com/asset/?id=5365990711
--http://www.roblox.com/asset/?id=9149814441

while wait(1) do
	script.Parent.Decal.Texture = "http://www.roblox.com/asset/?id=5365990711"
	wait(1)
	script.Parent.Decal.Texture = "http://www.roblox.com/asset/?id=9149814441"
end

I’m trying to change both decals

1 Like

It Never worked for me sorry :confused:

I tested my script in roblox studio and it worked without any errors.

The code we’re giving you seems to work fine on our end, I think it may be an issue with your end and may need to restart studio or just go to a brand new baseplate to ensure no other parts are interfering with the script and part. Or if you have the output open, could you tell us if there is any errors showing?

1 Like