Help pls with the image script!

HELP PLS

So me working with Cookie Studios are working on a new game
But if we make a textbox that displays any image with the id written in the textbox
Please Help.

SCRIPT IMAGE OF THE PICKIMAGE FUNCTION

script:

local event = game.ReplicatedStorage.Events.SetCompanyInfo
local things = script.Parent.MainFrame

local function checkErrorText()
	if things.Naming.TextBox.Text ~= "" then
		if string.len(things.Naming.TextBox.Text) < 5 then
			things.Naming.ERROR.Visible = true
			game.ReplicatedStorage.Events.SetCompanyInfo:FireServer("Cname", "")
		else
			things.Naming.ERROR.Visible = false
			game.ReplicatedStorage.Events.SetCompanyInfo:FireServer("Cname", things.Naming.TextBox.Text)
		end
	end
end

local function pickImage()
	if things.LogoPicking.TextBox.Text ~= "" then
		things.LogoPicking.ImageLabel.Image = "rbxassetid://" .. things.LogoPicking.TextBox.Text
		game.ReplicatedStorage.Events.SetCompanyInfo:FireServer("Cname", "rbxassetid://" .. things.LogoPicking.TextBox.Text)
	end
end

things.StartPage.CountinueButton.MouseButton1Click:Connect(function()
	things.Naming.Visible = true
	things.StartPage.Visible = false
end)

things.Naming.TextBox.Changed:Connect(checkErrorText)

things.Naming.CountinueButton.MouseButton1Click:Connect(function()
	if things.Naming.TextBox.Text ~= "" and things.Naming.ERROR.Visible == false then
		things.LogoPicking.Visible = true
		things.Naming.Visible = false
	end
end)

things.LogoPicking.TextBox.Changed:Connect(pickImage)

things.LogoPicking.Help.MouseButton1Click:Connect(function()
	script.Parent.LogoPickHelp.Visible = true
end)

script.Parent.LogoPickHelp.CountinueButton.MouseButton1Click:Connect(function()
	script.Parent.LogoPickHelp.Visible = false
end)

there is no errors in the output, pls help!

1 Like

Try using rbxthumb instead of rbxassetid. An example: rbxthumb://type=Asset&id=IMAGE_ID&w=420&h=420.

You can find more information about rbxthumb here:

1 Like

not work, this it what is says in output

Batch Thumbnail invalid thumbnail size for type=Asset&id=6399522603&w=135&h=135&filters=: Valid sizes for type Asset are 150x150, 294x144, 420x420, 480x270, 768x432

btw i am using the roblox image to use the images!

135x135 is not a supported size. I recommend using 420x420.

image

i am using this to get images Images - Creator Marketplace (roblox.com)

it’s not because of your image. it’s because you are using an invalid size.
it says right there which sizes are valid:

yea but how do i know wich size is the image and use it ?

the image label is 135x135, uh hwo would i use the images ?

just use 150x150 because it’s the smallest size.

like this:
rbxthumb://type=Asset&id=IMAGE_ID&w=150&h=150

150x150 is to big for the image to fit, it will display is there somehow i can use 135x135 or is it not supported ?

it will still be fine even if you use 150x150
check this image:

https://www.roblox.com/asset-thumbnail/image?assetId=710679541&22&width=150&height=150&format=png

it’s a 150x150 image

if you have a 135x135 image label, the image will be resized to 135x135. you don’t have to worry about this.

uhm how do i copy the id, and paste it into the text label , where is the id ?
like i see the id but if i click i wont see it…

like this:

local image = string.format("rbxthumb://type=Asset&id=%s&w=150&h=150", things.LogoPicking.TextBox.Text)
things.LogoPicking.ImageLabel.Image = image

then send your remote event

game.ReplicatedStorage.Events.SetCompanyInfo:FireServer("Cname", image)

Buisness Simulator IN DEVELOPMENT - Roblox Studio 01.01.2023 13_27_53
is this ?

no, use this script instead:

local event = game.ReplicatedStorage.Events.SetCompanyInfo
local things = script.Parent.MainFrame

local function checkErrorText()
	if things.Naming.TextBox.Text ~= "" then
		if string.len(things.Naming.TextBox.Text) < 5 then
			things.Naming.ERROR.Visible = true
			game.ReplicatedStorage.Events.SetCompanyInfo:FireServer("Cname", "")
		else
			things.Naming.ERROR.Visible = false
			game.ReplicatedStorage.Events.SetCompanyInfo:FireServer("Cname", things.Naming.TextBox.Text)
		end
	end
end

local function pickImage()
	if things.LogoPicking.TextBox.Text ~= "" then
		local image = string.format("rbxthumb://type=Asset&id=%s&w=150&h=150", things.LogoPicking.TextBox.Text)

		things.LogoPicking.ImageLabel.Image = image
		game.ReplicatedStorage.Events.SetCompanyInfo:FireServer("Cname", image)
	end
end

things.StartPage.CountinueButton.MouseButton1Click:Connect(function()
	things.Naming.Visible = true
	things.StartPage.Visible = false
end)

things.Naming.TextBox.Changed:Connect(checkErrorText)

things.Naming.CountinueButton.MouseButton1Click:Connect(function()
	if things.Naming.TextBox.Text ~= "" and things.Naming.ERROR.Visible == false then
		things.LogoPicking.Visible = true
		things.Naming.Visible = false
	end
end)

things.LogoPicking.TextBox.Changed:Connect(pickImage)

things.LogoPicking.Help.MouseButton1Click:Connect(function()
	script.Parent.LogoPickHelp.Visible = true
end)

script.Parent.LogoPickHelp.CountinueButton.MouseButton1Click:Connect(function()
	script.Parent.LogoPickHelp.Visible = false
end)
1 Like

can’t you get one from the toolbox?
710679541

https://create.roblox.com/marketplace/asset/710679541/grey-wistful-wink?pageNumber=1&pagePosition=0&keyword=

1 Like

omg it works, tysm if i put a id it works

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.