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

How to make print hello if imagebutton have image : XYZ ?

How to make print("helo) if imagebutton have image : XYZ. ( if imagebutton = XYZ then print("Hello) - How to make this

Thanks and best regard -PPJASK

1 answer

✓ Accepted answer

I'm not that good of a scripter but here's my solution.

local image = script.Parent
image.Changed:Connect(function()
	if image.Image = "rbxassetid://example" then
		-- Code goes here!
	end
end)

We are getting the parent of the script and putting it into a variable for easy access. Then we check whenever the image is changed. We then check if the image's Image value is set to the required Image. If that is the case, then it will execute the code. Otherwise, nothing will happen.

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