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

Open Gui On Click and Change Image Not Working?

So, hello! I was making a menu GUI. I finished coding and went to test. Nothing happened. (Local Script) Code:

-- The IDs
openid = "5232239597"
closeid = "5232247205"

script.Parent.MouseButton1Click:Connect(function()
	if script.Parent.Image == "http://www.roblox.com/asset/?id="..openid then -- If its the open button
		script.Parent.Parent.MenuOptions.Visible = true
		script.Parent.Image = "http://www.roblox.com/asset/?id="..closeid -- Open and set it to close
	end
	if script.Parent.Image == "http://www.roblox.com/asset/?id="..closeid then -- If close
		script.Parent.Parent.MenuOptions.Visible = false
		script.Parent.Image = "http://www.roblox.com/asset/?id="..openid - Close and set open
	end
end)

Please help, Thanks, Blxefirx/Blue

2 answers

I'm very silly but, i think you need to have,

script.Parent.Image = "http://www.roblox.com/asset/?id=" ..openid 

I'm pretty sure you need a space.

1 comment

0

actually in lua it does not matter if you have space or not, you can write script.                                              Parent and it will work :)

Well first check if the image is not blank and second is that to set image you use this:

script.Parent.Image = "rbxassetid://"..openid

done.

1 comment

0

I'll give it a try!

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