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

How to use an image from an external website as a texture?

Asked by
Z0ggg 20
4 years ago

I've been using NASA's Mars Rover Photo web api with HttpService recently and I've gotten pretty far. I've managed to get images from specific cameras of the Curiousity Rover, but I can't figure out how to slap the image onto a decal.

API link: https://api.nasa.gov/mars-photos/api/v1/rovers/curiosity/photos?sol=1000&camera=fhaz&api_key=DEMO_KEY Photo link my script has managed to grab: https://mars.jpl.nasa.gov/msl-raw-images/proj/msl/redops/ods/surface/sol/01000/opgs/edr/fcam/FRB_486265257EDR_F0481570FHAZ00323M_.JPG

So far I've experimented and tried setting the decal texture directly to the link like this:

workspace.Part.Decal.Texture = [photo url]

but to no avail.

I thought I could use HttpService again and set the response from GetAsync as the texture property like so:

httpService = game:GetService("HttpService")
workspace.Part.Decal.Texture = httpService:GetAsync([photo url])

and nothing.

Am I doing something wrong? Is it a Roblox Security measure? I get if it's a security thing to not allow images from external sites, but there's gotta be a way I can upload the image to the Roblox library and use it from there if security is the case.

If there is any way I can get this image on Roblox pls tell, I will be forever grateful, I don't really want my work to go to waste. Thank you in advance :)

0
also tell me if you need to see more code Z0ggg 20 — 4y
0
I don't think it's possible to display non-uploaded images via script. You would have to upload the image to Roblox manually, which I doubt fits into what you want to do. I've never really worked with HttpService, but I seriously don't think Roblox would allow you to grab images from the internet without them having to go through Roblox moderation and all that... I like the concept though RiskoZoSlovenska 378 — 4y
0
Yeah, I get what you're saying. I'm still hoping there's some way to upload photos through script so moderation gets a look at the photos. Thanks Z0ggg 20 — 4y
0
you can get the image data from a website using httpservice ig but aside from that /shrug royaltoe 5144 — 4y
View all comments (4 more)
0
@royaltoe when I try to print the response from the image link it gives me some odd question mark character. I don't really no how to turn the image data into an actual usable image. Z0ggg 20 — 4y
0
i'm not sure either sorry royaltoe 5144 — 4y
0
I think you have to do this manually. There's no way to automatically submit images to moderation from a script as far as I know (otherwise there would be spam). f59ph_iv 0 — 4y
0
Suppose (although it's obviously unlikely) someone managed to compromise NASA's site (or any other site for that matter) and display inappopriate photos on it. Roblox would be in serious legal trouble for allowing these images to be displayed within a game on their platform. f59ph_iv 0 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

Well, depending on how dedicated you are, you could find an API to find the color of every pixel, and make a ton of TextLabels and change their color to the color of the pixel and make the text blank and make their size exactly 1 pixel. Your game would probably get moderated for it.

HOWEVER, It has been done.

There was a place that did it, it appears to be not working anymore, but it did work at one point. tl;dr: You'll probably get banned, it's a filter bypass. Don't do it. Read above on how to do it.

Ad

Answer this question