Script to place images based on text not doing anything

I’m making a script that places an image of a letter for each letter typed into a TextLabel. However, the script does nothing. Script and Explorer provided below.

local characters = {
	["A"] = {11436216463, 6},
	["B"] = {11436243733, 6},
	["C"] = {11436295195, 6},
	["D"] = {11436593663, 6},
	["E"] = {11436607426, 5},
	["F"] = {11436797194, 5},
	["G"] = {11436897186, 6},
	["H"] = {11436918806, 6},
	["I"] = {11436928934, 2},
	["J"] = {11436950442, 6},
	["K"] = {11436957976, 6},
	["L"] = {11436992416, 5},
	["M"] = {11437140015, 7},
	["N"] = {11437197549, 7},
	["O"] = {11437211159, 6},
	["P"] = {11437235006, 6},
	["Q"] = {11437239090, 7},
	["R"] = {11437249948, 6},
	["S"] = {11437332392, 6},
	["T"] = {11437382892, 6},
	["U"] = {11437454737, 6},
	["V"] = {11437469140, 7},
	["W"] = {11437479428, 7},
	["X"] = {11437484961, 7},
	["Y"] = {11437524359, 6},
	["Z"] = {11437534762, 6},
	["a"] = {11437560815, 5},
	[" "] = {0, 0}
}
local dotstaken = 0
script.Parent.TextBox:GetPropertyChangedSignal("Text"):Connect(function()
	dotstaken = 0
	local detectstring = string.split(script.Parent.TextBox.Text, "")
	for i, v in pairs(detectstring) do
		local new = Instance.new("ImageLabel")
		new.Parent = script.Parent.Frame
		new.BackgroundTransparency = 1
		new.ScaleType = Enum.ScaleType.Crop
		if characters[v][1] ~= 0 then
			new.Image = "rbxassetid://" .. characters[v][1]
		end
		new.ImageColor3 = Color3.fromRGB(255, 170, 0)
		new.Size = UDim2.new(0, characters[v][2]*10, 0, 90)
		new.Position = UDim2.new(0, dotstaken*10, 0, 0)
		dotstaken = dotstaken + characters[v][2] + 1
	end
end)

image

After the script is run, I don’t see any new images being placed under Frame. I am already setting the parent of the new instance through the script.

Any help is appreciated.

Good sir, these values are sadly DECAL values.

Placing it into roblox.com/library/idHere shows the type as Decal. U - R160/179 - Roblox

This inherently freaking sucks. There is no easy way to convert all of these. So here’s what you can do. Create a blank ImageLabel, copy the ID and paste it into it. It’ll then convert the ID into a IMAGE ID, then paste it back into your config in your script.

Have a great day.

1 Like

No, these are asset IDs. I copied them via a Roblox website plugin.
Okay, never mind. It doesn’t copy the proper ID as I expected it to. Whoops.

Anyway, this doesn’t solve the issue of the images not showing up in the Explorer at all (basically, the script appears to do nothing).

Well, we can work on that now that we’ve got that out the way.
https://i.gyazo.com/be82e3fda6e12def69ff8f5c6e0fb8ea.mp4

Shove some prints in there, and see what’s not working.

I’ve tried that already. Oddly enough, the entire script runs.

When you’re looking in the explorer, are you looking in the PlayerGui, or the StarterGui?

1 Like

Ah… I was looking in the StarterGui. My bad, I overlooked a simple mistake. Everything works now, thanks!

1 Like

Ah… New dev problems. You’ll find a time when you will know every error in the book lol.

I wouldn’t call myself a new developer as I’ve been doing this for years, but I’m prone to overlooking things. Thanks for pointing it out to me!

1 Like

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