Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Imagelabel not loading image??

Asked by 3 years ago

So. In my game a player is able to input a id into a textbox. Which then is supposed to change the imagelabels texture to the id the player inputted.. But for some reason its not loading the image??

Heres my code(Inside a local script).

script.Parent.FocusLost:Connect(function(Enter)
    if Enter == true then
        if #script.Parent.Text > 0 then
            if tonumber(script.Parent.Text) then
                script.Parent.Parent.Parent.IMAGE.Image = "http://www.roblox.com/asset/?id="..script.Parent.Text -- // PROBLEM OCCURS HERE!
            else
                script.Parent.Text = "NOT A NUMBER!"
                wait(0.5)
                script.Parent.Text = "IMAGE ID"
            end
        else
            script.Parent.Text = "TEXTBOX IS EMPTY!"
            wait(0.5)
            script.Parent.Text = "IMAGE ID"
        end
    end
end)

Answer this question