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

Resize cookie on click?

I can't figure out how to make the script make the cookie increase size then wait and decrease back to normal size whenever it's clicked. Please help!

function Click() -- When the cookie is clicked
	Player.Cookies.Value = Player.Cookies.Value + 1
	script.Parent.Size = Vector3.new {0, 300},{0, 300}
	wait(0.15)
	script.Parent.Size = Vector3.new {0, 250},{0, 250}
	
end
script.Parent.MouseButton1Click:connect(Click)

1 answer

✓ Accepted answer

GuiObject's size and position properties do not hold Vector3 datatypes. They require UDim2 datatypes.

function Click() -- When the cookie is clicked
    Player.Cookies.Value = Player.Cookies.Value + 1
    script.Parent.Size = UDim2.new(0, 300, 0, 300)
    wait(0.15)
    script.Parent.Size = UDim2.new(0, 250, 0, 250)
end

script.Parent.MouseButton1Click:connect(Click)

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