Getting decal ID from user's input in TextBox

I’m attempting to obtain the player’s input (with a decal ID) from the TextBox to replace the current texture with the new texture in my tool, identified as Sign. Could I obtain some assistance?

This is what I’ve created so far:

script.Parent.MouseButton1Click:Connect(function()
	local aim = game.Players.LocalPlayer.Backpack.Sign.Handle.Image.Decal.Texture
    local byText = script.Parent.Parent.TextBox.Text

aim = "rbxassetid://"..byText
end)

image
image

1 Like

When I equip the tool, it’s removed from the Backpack.

1 Like
script.Parent.MouseButton1Click:Connect(function()
	local aim = game.Workspace.Baseplate.Decal
local byText = script.Parent.Parent.TextBox.Text
	aim.Texture = "rbxassetid://"..byText
end)

Works for me, although you’d need to change the aim value. Also, remember there is a difference between decals and assetids. Using the id from, https://www.roblox.com/library/904635292/Clothes would not work as it is a decal, however, Clothes - Roblox works because it is an image.

No, that’s not what I’m looking for. I do acknowledge the decal between decals and assets, but the part that provides the decal is identified as “Image”. Also, the local aim = game.Workspace.Baseplate.Decal won’t function as you’re specifically targeting at the baseplate, not the tool I was looking for.

To add more sense to my inquiry, I’d want the sign’s decal to be changed when clicked on “Submit”, that executes the ID from the textbox the player has inputted.

*Note that the current decal is already uploaded, not from the textbox.

I’d want the decal’s ID to function. I’ve been also told that you’d need to use remote events.

1 Like

To be honest a Remote Event would most definitely be the right way to look at this.

What I suggest you’d do is have an event in Replicated Storage, Fire it every time you want to submit a decal ID so that the server can see what ID your character is holding.

After you set that up, you should check if the ID is a valid decal ID or else this can error in output.

You can manage this by using MarketPlaceService:GetProductInfo()

1 Like

Reason it’s not working is because you’re reassigning aim rather than changing the value of what aim is assigned to. Instead do

local aim = game.Players.LocalPlayer.Backpack.Sign.Handle.Image.Decal
local byText = script.Parent.Parent.TextBox.Text
aim.Texture = "rbxassetid://"..byText
1 Like

Alright, it functions as I’ve inserted a RemoteEvent in ReplicatedStorage that’s fired from the localscript to the script in SSS, which publicly shows the decal to others. Thank you all for the assistance.

2 Likes