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

Inserted decal ID won't show on part?

function onKeyPress(inputObject, gameProcessedEvent)
	if inputObject.KeyCode == Enum.KeyCode.Q then
		workspace.Pet.Decal.Texture = "rbxassetid://"..script.Parent.Text
	end
end
 
game:GetService("UserInputService").InputBegan:connect(onKeyPress)

when you insert a decal ID it should show up on the brick, but this won't work. Any help?

Error message 17:51:07.382 - Image "rbxassetid://68437732" failed to load in "Workspace.Pet.Decal.Texture": Failed to resolve texture format

1 answer

✓ Accepted answer

When using decals, be sure you subtract 1 from the ID. If it still does not work, keep subtracting, as sometimes the IDs can end up a couple apart.

Also do note that I recommend adding an if statement to ensure gameProcessedEvent is false so it doesn't pick up chat input.

Example:

function onKeyPress(inputObject, gameProcessedEvent)
    if inputObject.KeyCode == Enum.KeyCode.Q and gameProcessedEvent == false then
        workspace.Pet.Decal.Texture = "rbxassetid://"..script.Parent.Text
    end
end

game:GetService("UserInputService").InputBegan:connect(onKeyPress)

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