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.
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:
Add a .FocusLost event to see when they press enter.
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)