Custom crosshair asset ID not working

I have this GUI that the player can input an image ID and have that image show in the preview box and become that players crosshair in the game. But the image doesn’t show when it gets added and in the video below you can see that the ID changes when I paste it directly into the image property.

I plan to use ProfileService to save the url

local crosshairFrame = script.Parent
local crosshairIDinput = crosshairFrame:WaitForChild("Input"):WaitForChild("InputID")
local crosshairPreview = crosshairFrame:WaitForChild("preview"):WaitForChild("previewImage")

crosshairIDinput:GetPropertyChangedSignal("Text"):Connect(function()
	crosshairPreview.Image = "http://www.roblox.com/asset/?id=".. crosshairIDinput.Text
end)
5 Likes

Can you try changing the url to:

“rbxassetid://”… crosshairIDinput.Text

Still the same as before. Nothing

After you asign the image I think you misstyped HTTPS with HTTP (line 6)
Correction:

crosshairPreview.Image = "https://www.roblox.com/asset/?id=".. crosshairIDinput.Text

That didn’t do it either but i did discover something.

I guess players would have to go to the decal page?

I guess you can the just change the the url?

crosshairPreview.Image = "https://www.roblox.com/catalog/"..  crosshairIDinput.Text

OR do:

"rbxassetid://".. crosshairIDinput.Text

Nope. It still stays blank…

I edited something, maybe this works?

1 Like