Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Instancing image not working ?

Just.. Instancing doesn't work ? i know im writing something wrong for the image what is it ??

TextLabel2 = Instance.new("TextLabel", GUI)
ImageLabel2 = Instance.new("ImageLabel", GUI, TextLabel2)
ImageLabel2.Image = "http://roblox.com/asset/?id=156071939"

i try looking the wiki it says image thats all i get i don't know how to write it pls help :/

2 answers

✓ Accepted answer
  • Instance.new

    • You should remove TextLabel2 from the second line, because Instance.new does not have a 3rd argument.
  • Image

    • There is no 'new' after image. You're not creating a an object from a class or anything, you're just setting a value to a property.

This should be your revised code:

TextLabel2 = Instance.new("TextLabel", GUI)
ImageLabel2 = Instance.new("ImageLabel", TextLabel2)
ImageLabel2.Image = "http://roblox.com/asset/?id=156071939"

2 comments

0

then how do i instance it into the textlabel ?

0

You set the parent of the object in the second argument of the function, or you can manually set it with the 'Parent' property. In this case, it's already set for you.

To make this work AND be instanced into the TextLabel, you need to set the parent for ImageLabel2, by doing ImageLabel2.Parent = TextLabel2

TextLabel2 = Instance.new("TextLabel", GUI)
ImageLabel2 = Instance.new("ImageLabel", GUI)
ImageLabel2.Parent = TextLabel2
ImageLabel2.Image = "http://roblox.com/asset/?id=156071939"

This discussion is preserved as it was. New answers, comments, and votes are closed.