Greetings fellow developers,
So, I am trying to make a 2d game.
The thing is that for animation I need to change different frames which change. However, when I tried coding this I run into some issues.
local ID = script.Parent.Image
wait(8)
ID = "rbxassetid://5993496399"
print("Time!!")
wait(8)
ID = "rbxassetid://5993495870"
This simple local script is supposed to load a frame, wait 8 seconds and then change this specific image label to an other frame (ImageLabel.Image).
If you try this, I won’t work.
Your image will stay the same as you had previously set it.
The solution I could think of was to change the format:
You are setting the ID variable to the Image label then trying to just set the variable ID to “rbxassetid://5993496399” instead you need to set the ImageLabel’s Image property
so since ID is the image label just reference the property by doing ID.Image
> local ID = script.Parent.Image
>
> wait(8)
> ID.Image = "rbxassetid://5993496399"
> print("Time!!")
> wait(8)
> ID.Image = "rbxassetid://5993495870"