Hello,
So basically im making an inventory gui, and each item folder has an int value with the image id. The code loops through the players inventory and makes a frame with the item’s name and its rarity. Its also supposed to show the items image, but it just doesnt.
This is the line of the code thats supposed to show the image:
clonedFrame.ItemImage.Image = "http://www.roblox.com/asset/?id="..tostring(v.ImageId.Value)
And yes, the ID’s are correct.
2 Likes
why did you post it twice?
2 Likes
do “rbxassetid://urid” not url pls pls
1 Like
Sorry, i accidentally posted it before it was ready.
can u read my solution???
walshuk
(vincenzo)
March 17, 2022, 4:10pm
#7
By this I’m assuming you’ve already pasted your ID into a Decal and retrieved the new ID, correct?
1 Like
Valkyrop
(JustAGuy)
March 17, 2022, 4:11pm
#8
Use “rbxassetid://”…v.ImageId.Value|
Make sure the ImageId is an INT value / or a number value
1 Like
Yes, thats exactly what i did.
walshuk
(vincenzo)
March 17, 2022, 4:13pm
#10
Can you send the full script as that line of code should work perfectly fine on its own
Valkyrop
(JustAGuy)
March 17, 2022, 4:13pm
#11
With that issue, you need a number/int value at the end, not a string.
commitblue
(commitblue)
March 17, 2022, 4:14pm
#12
btw pls don’t use concentation
use string format
string.format("rbxassetid://%s","I'd")
Oh okay, thanks. Still didn’t fix the problem though.
Valkyrop
(JustAGuy)
March 17, 2022, 4:16pm
#14
Make sure your value is a number/int, not a string, it’s easier to work with int/numbers in such cases
dont use %s for numbers
do
string.format("rbxassetid://%.f","I'd")
1 Like
walshuk
(vincenzo)
March 17, 2022, 4:17pm
#16
The Image property is supposed to be a string though, which is why it’s being converted from a number/int to string for concatenation…?
Valkyrop
(JustAGuy)
March 17, 2022, 4:17pm
#17
True, but the end of "http://www.roblox.com/asset/?id= should be a number.
commitblue
(commitblue)
March 17, 2022, 4:18pm
#18
But numbers can concentate with strings. So it’s not a problem.
2 Likes
but roblox’s new dumb update now adds a million decimals to numbers when you do tostring(which is what is applied to numbers when u concatenate them)
so something like 0.3 would return 0.3000000000002
instead, you should use string.format with %.f
clonedFrame.ItemImage.Image = "rbxassetid://"..tostring(v.ImageId.Value)