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

Why won't this image label change?

Asked by 5 years ago

I'm trying to make this image change when a button is pressed, but it only disappears.

local phone = script.Parent.Parent.PhoneTemplate
local images = {
    "rbxassetid://1996485774",
}

phone.Image = images[1]

This is only a snippet of my script, also thanks if you can help me out!

0
Try doing something like: script.Parent.MouseButton1Click:Connect (function() script.Parent.Parent.Phonetemplate.Image = rbxassetid://1996485774. (Sorry if it looks bad; I'm on phone SBlankthorn 329 — 5y

2 answers

Log in to vote
2
Answered by
Amiaa16 3227 Moderation Voter Community Moderator
5 years ago

As Horribilis said, the problem is the id you used.

You used the decal id, while you should use the image id of the decal which in your case is 1996485756.

You can use this api to turn a decal id into its image id.

I think you can also put the decal id into a Decal in roblox studio and it should turn it to the image id, but not sure.

0
The decal thing worked great, thanks! CaptainAlien132 225 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

The problem is not your script, it's your image. I ran your same script with a different image and it worked fine. You likely put in the wrong ID.

0
It is the correct ID, I checked on the website. CaptainAlien132 225 — 5y

Answer this question