How would I make a imagelable using a ModuleScript?

Hi I have a question with scripting it is, how to make a imagelable using a ModuleScript! There would be a few imagelables like you see in the text at the bottom.
I do know how to make a textlable using it.

Example👇

local function CreateTextLabel(Size,Position,Text)
	local TextLabel = Instance.new("TextLabel")
	TextLabel.BackgroundTransparency = 1
	TextLabel.Size = Size
	TextLabel.Position = Position
	TextLabel.Text = Text
	TextLabel.ZIndex = 10
	TextLabel.Font = "PatrickHand"
	TextLabel.TextScaled = true
	TextLabel.TextColor3 = Color3.new(1,1,1)
	TextLabel.TextStrokeColor3 = Color3.new(0,0,0)
	TextLabel.TextStrokeTransparency = 1
	TextLabel.Parent = Frame
end

CreateTextLabel(UDim2.new(0.5,0,0.1,0),UDim2.new(0.25,0,0.4,0),"Hi")
CreateTextLabel(UDim2.new(0.5,0,0.05,0),UDim2.new(0.25,0,0.475,0),"Hi")
CreateTextLabel(UDim2.new(0.5,0,0.03,0),UDim2.new(0.25,0,0.55,0),"Hi.")

So I want to make a Imagelable in a script I think it would be something the same of that can someone show me a script on how to make imagelables?

make it the same way as you did with the TextLabel
and changing it’s properties are easy because if you don’t remember you can always look at a ImageLabel to see what properties it has

@D0RYU Ok but I have 2 questions, 1 is how will I put the image in that script or asset id
and 2 is would I copy and paste the imagelable script to have multiple images or is there a way to have multiple images without copy and pasting the script.

you could easily have a for loop run Instance.new() multiple times to make multiple labels

also change the image like this

ImageLabel.Image = "rbxassetid://YourImageID"

replace YourImageID with the id of the image, this will obviously be numbers

more information here ImageLabel | Roblox Creator Documentation

@D0RYU One more thing sorry if I am disturbing…

So at the first line instead of

local function CreateTextLabel(Size,Position,Text)

I would write for the imagelable

local function CreateImagleLable(Size,Position,Image)

1 Like

I recommend watching some tutorials online, as this will help you learn.
Goodluck!

you are fine

make the function parameters however you want, this seems fine

1 Like

Thank you for helping me! Have a great day!:slight_smile:

2 Likes