Cant figure out how to make a textbox change a decal

Hello. By no means am I a scripter, And I need help.

I’m making a pirate game and I want anyone to change the ships flag. (Kind of how bloxburg changes posters) I want it so the player enters a decal ID and it takes the decal id and sets it to the flag decals texture. But this script I have is not working.

I have looked for solutions everywhere, But I’ve had trouble finding something like this.

unknown2
unknown3
unknown4

1 Like

By typing in textbox.Text you are essentially creating a reference to what the text currently says. That means that the variable is now containing the string “Enter the flags decal ID”. The proper way to do it:

  1. Add a .FocusLost event to see when they press enter.
  2. Tada!
local aim = workspace.Flag.Decal -- workspace is a global variable
local byText = script.Parent.TextBox -- Make a reference to the textbox, not the text it currently says

byText.FocusLost:Connect(function()
   aim.Texture = "rbxassetid://"..byText.Text -- Set texture
end)
5 Likes

Pretty sure that the .Texture property requires an Asset ID. Check this thread out: