This PART OF A SCRIPT is supposed to change the texture of a trail in the player. So someone puts a decal id in the input* in a text box and then clicks a button (script.Parent) the trail texture changes to the decal id in the input.
trail.Texture = "http://www.roblox.com/asset/?id=".. script.Parent.Parent.Input.Text --Input*
This is the error I get:
Image "https://assetgame.roblox.com/asset/?id=2780518" failed to load in "Workspace.kittonlover101.Torso.Trail.Texture": Request failed
Thanks!
pcall
, since any kind of text can go in a TextBox
.local input = script.Parent.Parent.Input local success, msg = pcall(function() trail.Texture = "http://www.roblox.com/asset/?id="..input.Text end) if success then -- code else error("An error occurred:", msg) end
Sometimes you'll have to subtract the ID by one or sometimes even more than one. I think this is because of images and decals being different but I don't remember.
I would simply do this :
trail.Texture = 'rbxassetid://'..tonumber(input.Text) - 1 -- May sometimes have to subtract more than one sometimes
I use 'rbxassetid://' since it's much shorter. I then use tonumber to get the number of the ID and subtract it by one. Now when you put in the ID, the ID will subtract itself by one and it'll work.