How would I use a TextBox to change a property of an object?

Hello, Devfourm I am making a game where you can add a part and customize it to your liking! I want to add a feature where if you add a particle emitter to the part, you can change the image ID. But to do this I need a TextBox to type the ID into. I just want to know if there is a way I could get the input from the TextBox, and change the property of the Particle Emitter ImageID with it.

Heres a video:

Thank you! :slight_smile:

TextBox.FocusLost:Connect(function(pressedEnter) -- the player submitted the textbox text
    if not pressedEnter then -- doesn't run if the player simple clicked off the textbox
       return
    end
    ParticleEmitter.Texture = "rbxassetid://" .. TextBox.Text -- set the ParticleEmitter to the textbox text
end)

TextBox.FocusLost
ParticleEmitter.Texture

?

1 Like