I’m working on a way to make it so when you insert an ID into a TextBox, the image changes to the ID in the TextBox that was set. The thing is, It doesn’t seem to be working and I’m getting no errors either.
Example:
Code:
local Screens = game.Workspace.Screens
local id = script.Parent.Text
script.Parent.Parent.Parent.Image.ImageLabel.Image = "rbxassetid://"..tostring(id)
local Screens = game.Workspace.Screens
local id = script.Parent
local enReq = true -- Only change text when focus lost on enter press
id.FocusLost:Connect(function(enterpressed)
if enReq and not enterpressed then
return
end
script.Parent.Parent.Parent.Image.ImageLabel.Image = "rbxassetid://"..tostring(id.Text)
end)
I’d try using focus lost, because what it’s doing right now is setting it to the text when the script runs (when the game starts)
Try this:
local Screens = game.Workspace.Screens
local id = script.Parent
local imageLabel = script.Parent.Parent.Parent:WaitForChild("Image"):WaitForChild("ImageLabel")
id.FocusLost:Connect(function()
imageLabel.Image = "rbxassetid://"..tostring(id.Text)
end)
Try adding a print in the function after it sets it and tell me if it prints. Seems kind of weird why it would do that, it should work. But I very well could have messed something up.
Try this. This might work, but let me know if it doesn’t of course
local Screens = game.Workspace.Screens
local id = script.Parent
local imageLabel = script.Parent.Parent.Parent:WaitForChild("Image"):WaitForChild("ImageLabel")
id.FocusLost:Connect(function()
imageLabel.Image = id.Text
end)
Do you mind sending me a version of the place as a file? It would make this a million times easier, but you don’t have to if you don’t want to. I completely understand if you don’t.