Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why does this surface GUIs image only turn white when told to change to a different image?

I'm trying to make a computer with a changeable background, but it only turns white when the button is clicked (which is also a surface GUI)

local button = script.Parent
local sound = script.Parent.Parent.Parent.Parent.Parent.Parent.Click

button.MouseButton1Down:connect(function()
	script.Parent.Parent.Parent.Parent.Thumbnail.Image = '967822834'
	sound:Play()
end)


I'm a bit of a noob, so please go easy on me!

1 answer

✓ Accepted answer

This is not how you format the id use rbxassetid

I would also set the id in studio then copy the id format as studio will get the correct id for you.

In your case you would use

local button = script.Parent
local sound = script.Parent.Parent.Parent.Parent.Parent.Parent.Click

button.MouseButton1Down:connect(function()
    script.Parent.Parent.Parent.Parent.Thumbnail.Image = 'rbxassetid://967822831'
    sound:Play()
end)

Hope this helps.

This discussion is preserved as it was. New answers, comments, and votes are closed.