local button = script.Parent local toggled = false local function onButtonActivated() if toggled == false then button.Image = "rbxgameasset://Images/ImageButtonActivated" toggled = true else button.Image = "rbxgameasset://Images/ImageButtonNormal" toggled = false end end button.Activated:Connect(onButtonActivated)
This is my script for a click changing my ImageButton to something else. I need to know how to make it change back to ImageButtonNormal after a certain waiting time.
local Button = script.Parent local ImageActivated = "rbxgameasset://Images/ImageButtonActivated" local ImageNormal = "rbxgameasset://Images/ImageButtonNormal" local function OnButtonActivated() Button.Image = ImageActivated delay(3, function() Button.Image = ImageNormal end) end Button.Activated:Connect(onButtonActivated)