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

Why is the Image not rendering?

Asked by 4 years ago
Edited 4 years ago

Hey,

I'm having trouble with Inserting an Image into a ImageLabel via. a LocalScript

Here is my Code:

local Item1 = script.Parent.Parent.List["1Item"]

game.ReplicatedStorage.FoodClickHandler.OnClientEvent:Connect(function(Food, ImageId)   
    Item1.Image = "http://www.roblox.com/asset/?id="..ImageId
end)

The ImageId is the following: 720401998

If the Local Script runs the Image changes to a transparent background!

I hope somebody can help me

EDIT There is a Error in the console:

 Image "https://assetdelivery.roblox.com/v1/asset?id=720401998" failed to load in "Players.RedstonecraftHD.PlayerGui.FoodGui.List.1Item.Image": Request failed
0
Send server script that fires the event programmerHere 371 — 4y
0
Already done... RedstonecraftHD 25 — 4y
0
SERVER CODE: local clickDetector = script.Parent.ClickDetector local RemoteEvent = game.ReplicatedStorage.FoodClickHandler clickDetector.MouseClick:Connect(function(player) local Food = script.Parent.Name local ImageId = game.ServerStorage.FoodIconIds:FindFirstChild(Food) RemoteEvent:FireClient(player, Food, ImageId.Value) end) RedstonecraftHD 25 — 4y
0
Not in a comment, there is an edit button for a reason programmerHere 371 — 4y
0
Sry RedstonecraftHD 25 — 4y

1 answer

Log in to vote
1
Answered by
2ndwann 131
4 years ago
Edited 4 years ago

Instead of doing

 Item1.Image = "http://www.roblox.com/asset/?id="..ImageId

I would simply suggest that you would do

Item1.Image = "rbxassetid://" .. ImageId

The reason for this is that images do not render if you provide a URL from the Roblox website. There is a special URL, rbxassetid:// that you will have to use for it to render.

If you would put an ordinary URL, the image would not load and it would turn into the transparent background you were talking about.

I hope you would find this as a solution.

0
It isn't working! I found a Error in the console (view edit in the post). RedstonecraftHD 25 — 4y
0
Your image may be deleted or under moderation by Roblox. 2ndwann 131 — 4y
Ad

Answer this question