I created an if statement that went like this and is used for a custom inventory button
script.Parent.MouseButton1Click:Connect(function() if script.Parent.Image == "http://www.roblox.com/asset/?id=1333146830" then script.Parent.Parent.Frame.Visible = true script.Parent.Parent.Frame.itemname.Text = "AzureSword" script.Parent.Parent.Frame.item.Image = "http://www.roblox.com/asset/?id=1333146830" end end)
when I click on this image button the frame doesnt become visible and nothing happens even when the image is accurate
When you change the id of a imageLabel/Button, the id gonna be "rbxassetid://SomeIdHere".
So your script would be this
script.Parent.MouseButton1Click:Connect(function() if script.Parent.Image == "rbxassetid://1333146830" then --Correct format script.Parent.Parent.Frame.Visible = true script.Parent.Parent.Frame.itemname.Text = "AzureSword" script.Parent.Parent.Frame.item.Image = "rbxassetid://1333146830" end end)