Image on a image button not working

i’m trying to change the image of a imagebutton but it isn’t showing

when i click on image in properties and then press enter (changing nothing) it does show up

local trigger = game.Workspace:WaitForChild("Part").trigger
local player = script.Parent.Parent



local function  change()
	local val = script.Parent.val

	if val.Value == false then
		val.Value = true
		local button = Instance.new("ImageButton")
	
		button.BackgroundTransparency = 1
		button.Image = "14737213439" -- here is where i change the image
		button.Parent = player:WaitForChild("PlayerGui").buttons.main.Items
		button.ZIndex = 25
		wait(1)
	end
end



trigger.Triggered:Connect(giveballtrap)

This isn’t working because you are inserting the ID, just by itself.
All imagelabels or imagebuttons have some string before the id, like “rbxassetid:// [insert id here]”
I dont know what the string was for the id, but try this one out.

button.Image = "rbxassetid://14737213439"
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.