Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Inserted decal ID won't show on part?

Asked by 7 years ago
Edited 7 years ago
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

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

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)

Ad

Answer this question