[Solved] Change image by using attribute
Gamepenciler
Artist/Game DeveloperMember, PRO Posts: 326
Hello,
I want to change the image by using attribute but I can't make it work.
I'm trying to do this:
self.image = imagename..game.attribute(int)..".png"
I wanted the last name of the file to be an attribute but It doesn't seem to work, anybody have done this to correct this line of code?
Artist/Game Developer / Animator at your service..
Comments
Hi @Thorhammer - is this any good for you? The top value, where the game.image attribute value references the values in the table, includes a random value only for my own amusement, to see whether that would work...
Place quotes around the name of the file, no need to include the extension (.png).
So . . . change this:
imagename..game.attribute..".png"
. . . to this . .
"imagename"..game.attribute
What @Socks said!
oh i made it wrong now it's working thanks @Socks !
Artist/Game Developer / Animator at your service..